mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
WindowServer: Don't invalidate already frontmost window for moving to front.
This commit is contained in:
parent
e115ae5641
commit
786b903d62
Notes:
sideshowbarker
2024-07-19 15:59:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/786b903d62f
5 changed files with 18 additions and 8 deletions
|
@ -7,6 +7,8 @@
|
|||
#include <WindowServer/WSWindow.h>
|
||||
#include <WindowServer/WSWindowManager.h>
|
||||
|
||||
//#define LOG_GUI_SYSCALLS
|
||||
|
||||
void Process::initialize_gui_statics()
|
||||
{
|
||||
Font::initialize();
|
||||
|
@ -104,9 +106,6 @@ int Process::gui$get_window_backing_store(int window_id, GUI_WindowBackingStoreI
|
|||
|
||||
int Process::gui$invalidate_window(int window_id, const GUI_Rect* rect)
|
||||
{
|
||||
#ifdef LOG_GUI_SYSCALLS
|
||||
dbgprintf("%s<%u> gui$invalidate_window (window_id=%d, rect=%p)\n", name().characters(), pid(), window_id, rect);
|
||||
#endif
|
||||
if (window_id < 0)
|
||||
return -EINVAL;
|
||||
if (rect && !validate_read_typed(rect))
|
||||
|
@ -114,6 +113,12 @@ int Process::gui$invalidate_window(int window_id, const GUI_Rect* rect)
|
|||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end())
|
||||
return -EBADWINDOW;
|
||||
#ifdef LOG_GUI_SYSCALLS
|
||||
if (!rect)
|
||||
dbgprintf("%s<%u> gui$invalidate_window (window_id=%d, rect=(entire))\n", name().characters(), pid(), window_id);
|
||||
else
|
||||
dbgprintf("%s<%u> gui$invalidate_window (window_id=%d, rect={%d,%d %dx%d})\n", name().characters(), pid(), window_id, rect->location.x, rect->location.y, rect->size.width, rect->size.height);
|
||||
#endif
|
||||
auto& window = *(*it).value;
|
||||
auto event = make<WSEvent>(WSEvent::WM_Invalidate);
|
||||
if (rect)
|
||||
|
|
|
@ -94,9 +94,9 @@ public:
|
|||
|
||||
enum class GMouseButton : byte {
|
||||
None = 0,
|
||||
Left,
|
||||
Middle,
|
||||
Right,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
Middle = 4,
|
||||
};
|
||||
|
||||
enum GKeyboardKey {
|
||||
|
|
|
@ -18,7 +18,7 @@ void GLabel::set_text(String&& text)
|
|||
update();
|
||||
}
|
||||
|
||||
void GLabel::paint_event(GPaintEvent&)
|
||||
void GLabel::paint_event(GPaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
if (fill_with_background_color())
|
||||
|
|
|
@ -82,5 +82,9 @@ GWindow* make_launcher_window()
|
|||
}
|
||||
};
|
||||
|
||||
auto* dummy_button = new GButton(widget);
|
||||
dummy_button->set_relative_rect({ 5, 50, 70, 20 });
|
||||
dummy_button->set_caption("Dummy");
|
||||
|
||||
return window;
|
||||
}
|
||||
|
|
|
@ -193,9 +193,10 @@ void WSWindowManager::add_window(WSWindow& window)
|
|||
void WSWindowManager::move_to_front(WSWindow& window)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
if (m_windows_in_order.tail() != &window)
|
||||
invalidate(window);
|
||||
m_windows_in_order.remove(&window);
|
||||
m_windows_in_order.append(&window);
|
||||
invalidate(window);
|
||||
}
|
||||
|
||||
void WSWindowManager::remove_window(WSWindow& window)
|
||||
|
|
Loading…
Add table
Reference in a new issue