diff options
author | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2009-01-16 12:54:57 +0000 |
---|---|---|
committer | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2009-01-16 12:54:57 +0000 |
commit | 2c3371026c26e102b5f0115ef9307bdaa4dfa7f2 (patch) | |
tree | b29d03ac0979fad94972034857cb5f48db6bf415 /src/misc.c | |
parent | 80c97d876f59a062c1c8c1f52c20160172357903 (diff) | |
download | xfwm4-2c3371026c26e102b5f0115ef9307bdaa4dfa7f2.tar.gz |
* src/misc.h, src/misc.c, src/screen.h, src/screen.c, src/events.c,
src/menu.c, src/tabwin.c, src/placement.c, src/client.c,
src/moveresize.c, src/netwm.c: Need to invalidate our internal
monitor caching when adding/removing monitors with randr 1.2
(Old svn revision: 29263)
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/misc.c b/src/misc.c index cb60b58c3..dbba9ca03 100644 --- a/src/misc.c +++ b/src/misc.c @@ -235,67 +235,6 @@ placeSidewalks(ScreenInfo *screen_info, gboolean activate) } } -/* - gdk_screen_get_monitor_at_point () doesn't give accurate results - when the point is off screen, use my own implementation from xfce 3 - */ -gint -find_monitor_at_point (GdkScreen *screen, gint x, gint y) -{ - static gint cache_monitor = -1; - static gint cache_x, cache_y; - gint dx, dy, center_x, center_y; - guint32 distsquare, min_distsquare; - gint num_monitors, nearest_monitor, i; - GdkRectangle monitor; - - g_return_val_if_fail (GDK_IS_SCREEN (screen), -1); - - /* Cache system */ - if ((cache_monitor >= 0) && (x == cache_x) && (y == cache_y)) - { - return (cache_monitor); - } - - cache_x = x; - cache_y = y; - - /* No monitor has been eligible, use the closest one */ - - min_distsquare = ((guint32) 0xffffffff); - nearest_monitor = 0; - - num_monitors = gdk_screen_get_n_monitors (screen); - for (i = 0; i < num_monitors; i++) - { - gdk_screen_get_monitor_geometry (screen, i, &monitor); - - if ((x >= monitor.x) && (x < monitor.x + monitor.width) && - (y >= monitor.y) && (y < (monitor.y + monitor.height))) - { - cache_monitor = i; - return i; - } - - center_x = monitor.x + (monitor.width / 2); - center_y = monitor.y + (monitor.height / 2); - - dx = x - center_x; - dy = y - center_y; - - distsquare = (dx * dx) + (dy * dy); - - if (distsquare < min_distsquare) - { - min_distsquare = distsquare; - nearest_monitor = i; - } - } - - cache_monitor = nearest_monitor; - return (nearest_monitor); -} - gchar* get_atom_name (DisplayInfo *display_info, Atom atom) { |