mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
nitpicker: Consider menubar for pointer reports
The pointer-report facility used to report the screen-absolute position of the mouse pointer. For nitpicker clients, however, this position is meaningless because their coordinate is always constrained to the area below the menu bar. This patch offsets the reported position accordingly.
This commit is contained in:
parent
13cc423050
commit
b9cf2eade8
@ -972,13 +972,17 @@ void Nitpicker::Main::handle_input(unsigned)
|
||||
canvas_accessor.canvas());
|
||||
|
||||
Point const new_mouse_pos = user_state.mouse_pos();
|
||||
Point const menubar_offset = Point(0, Framebuffer_screen::MENUBAR_HEIGHT);
|
||||
Point const report_pos = new_mouse_pos - menubar_offset;
|
||||
|
||||
/* report mouse-position updates */
|
||||
if (pointer_reporter.is_enabled() && old_mouse_pos != new_mouse_pos)
|
||||
if (pointer_reporter.is_enabled() && old_mouse_pos != new_mouse_pos
|
||||
&& new_mouse_pos.y() >= 0)
|
||||
|
||||
Genode::Reporter::Xml_generator xml(pointer_reporter, [&] ()
|
||||
{
|
||||
xml.attribute("xpos", new_mouse_pos.x());
|
||||
xml.attribute("ypos", new_mouse_pos.y());
|
||||
xml.attribute("xpos", report_pos.x());
|
||||
xml.attribute("ypos", report_pos.y());
|
||||
});
|
||||
|
||||
/* update mouse cursor */
|
||||
|
Loading…
Reference in New Issue
Block a user