diff --git a/Kernel/ProcessGUI.cpp b/Kernel/ProcessGUI.cpp index 6329bdc876..2fc30ea578 100644 --- a/Kernel/ProcessGUI.cpp +++ b/Kernel/ProcessGUI.cpp @@ -7,6 +7,8 @@ #include #include +//#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::WM_Invalidate); if (rect) diff --git a/LibGUI/GEvent.h b/LibGUI/GEvent.h index e02aca777c..f697eef8f0 100644 --- a/LibGUI/GEvent.h +++ b/LibGUI/GEvent.h @@ -94,9 +94,9 @@ public: enum class GMouseButton : byte { None = 0, - Left, - Middle, - Right, + Left = 1, + Right = 2, + Middle = 4, }; enum GKeyboardKey { diff --git a/LibGUI/GLabel.cpp b/LibGUI/GLabel.cpp index 8898dab096..d99cdd569c 100644 --- a/LibGUI/GLabel.cpp +++ b/LibGUI/GLabel.cpp @@ -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()) diff --git a/Userland/guitest2.cpp b/Userland/guitest2.cpp index e9de8788ab..6d5cdb8b71 100644 --- a/Userland/guitest2.cpp +++ b/Userland/guitest2.cpp @@ -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; } diff --git a/WindowServer/WSWindowManager.cpp b/WindowServer/WSWindowManager.cpp index 8260ff2ffb..549d089cbc 100644 --- a/WindowServer/WSWindowManager.cpp +++ b/WindowServer/WSWindowManager.cpp @@ -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)