mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
WindowsServer+LibGUI: Avoid getting color under cursor outside screen
This patch fixes a crash in ColorPicker caused by the ColorSelectOverlay trying to request the color for a pixel outside the screen rect.
This commit is contained in:
parent
8515d7d5ab
commit
b46ea5158d
Notes:
sideshowbarker
2024-07-17 21:51:55 +09:00
Author: https://github.com/networkException
Commit: b46ea5158d
Pull-request: https://github.com/SerenityOS/serenity/pull/11526
3 changed files with 9 additions and 4 deletions
|
@ -160,9 +160,11 @@ private:
|
|||
virtual void mousemove_event(GUI::MouseEvent&) override
|
||||
{
|
||||
auto new_col = WindowServerConnection::the().get_color_under_cursor();
|
||||
if (!new_col.has_value())
|
||||
return;
|
||||
if (new_col == m_col)
|
||||
return;
|
||||
m_col = new_col;
|
||||
m_col = new_col.value();
|
||||
if (on_color_changed)
|
||||
on_color_changed(m_col);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue