mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
Fixup get_nsscreen_for_x()
This commit is contained in:
parent
221883dd31
commit
a4d932cc64
@ -885,7 +885,7 @@ _gdk_quartz_window_did_resign_main (GdkWindow *window)
|
||||
}
|
||||
|
||||
static NSScreen *
|
||||
get_nsscreen_for_x (gint x)
|
||||
get_nsscreen_for_point (gint x, gint y)
|
||||
{
|
||||
int i;
|
||||
NSArray *screens;
|
||||
@ -898,10 +898,8 @@ get_nsscreen_for_x (gint x)
|
||||
{
|
||||
NSRect rect = [[screens objectAtIndex:i] frame];
|
||||
|
||||
/* FIXME: Only horizontal layouts supported for now. Also
|
||||
* see comments in gdkscreen-quartz.c
|
||||
*/
|
||||
if (x >= rect.origin.x && x <= rect.origin.x + rect.size.width)
|
||||
if (x >= rect.origin.x && x <= rect.origin.x + rect.size.width &&
|
||||
y >= rect.origin.y && y <= rect.origin.y + rect.size.height)
|
||||
return [screens objectAtIndex:i];
|
||||
}
|
||||
|
||||
@ -1008,7 +1006,7 @@ _gdk_window_impl_new (GdkWindow *window,
|
||||
*/
|
||||
_gdk_quartz_window_gdk_xy_to_xy (private->x, private->y, &nx, &ny);
|
||||
|
||||
screen = get_nsscreen_for_x (nx);
|
||||
screen = get_nsscreen_for_point (nx, ny);
|
||||
screen_rect = [screen frame];
|
||||
nx -= screen_rect.origin.x;
|
||||
ny -= screen_rect.origin.y;
|
||||
|
Loading…
Reference in New Issue
Block a user