WindowServer: Don't invalidate already frontmost window for moving to front.

This commit is contained in:
Andreas Kling 2019-01-21 02:18:16 +01:00
parent e115ae5641
commit 786b903d62
Notes: sideshowbarker 2024-07-19 15:59:35 +09:00
5 changed files with 18 additions and 8 deletions

View file

@ -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)

View file

@ -94,9 +94,9 @@ public:
enum class GMouseButton : byte {
None = 0,
Left,
Middle,
Right,
Left = 1,
Right = 2,
Middle = 4,
};
enum GKeyboardKey {

View file

@ -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())

View file

@ -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;
}

View file

@ -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)