Fix compiz support with multiple desktops and monitors (issue #94)

This commit is contained in:
o9000
2016-01-16 12:09:05 +01:00
parent 285a53e1a3
commit 78fb4f5254

View File

@@ -162,29 +162,6 @@ int get_window_monitor(Window win)
int x, y, w, h; int x, y, w, h;
get_window_coordinates(win, &x, &y, &w, &h); get_window_coordinates(win, &x, &y, &w, &h);
if (server.viewports) {
int desktop = MIN(get_current_desktop(), server.num_desktops - 1);
// Window coordinates are relative to the current viewport, make them absolute
x += server.viewports[desktop].x;
y += server.viewports[desktop].y;
if (x < 0 || y < 0) {
int num_results;
long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
if (!x_screen_size)
return 0;
int x_screen_width = x_screen_size[0];
int x_screen_height = x_screen_size[1];
XFree(x_screen_size);
// Wrap
if (x < 0)
x += x_screen_width;
if (y < 0)
y += x_screen_height;
}
}
int best_match = -1; int best_match = -1;
int match_right = 0; int match_right = 0;
int match_bottom = 0; int match_bottom = 0;