static GC dockapp_border1GC, dockapp_border2GC, window_border1GC, window_border2GC, active_desktopGC, inactive_desktopGC, active_windowGC, inactive_windowGC;
static Atom supported_atom, num_desktops_atom, desktop_geometry_atom, current_desktop_atom, client_list_atom, client_desktop_atom, client_state_atom, active_window_atom, moveresize_window_atom;
-static Atom above_state, below_state, shaded_state, skip_pager_state, hidden_state;
+static Atom shaded_state, skip_pager_state, hidden_state;
static int desktop = -1;
static Window drag_window;
static int drag_x, drag_y;
static int drag_button;
static int dockapp_x, dockapp_y;
static unsigned int dockapp_width, dockapp_height, dockapp_border, dockapp_depth;
-static double scale;
+static double aspect, scale;
static int desktop_geometry_supported;
static int current_desktop_supported;
if (desktop_geometry_supported) {
get_atom_longs(desktop_geometry_atom, XA_CARDINAL, DefaultRootWindow(DADisplay), &states, &num_states);
root_width = states[0];
- root_height = states[0];
+ root_height = states[1];
XFree(states);
}
else {
XGetGeometry(DADisplay, DAWindow, &dockapp_root, &dockapp_x, &dockapp_y, &dockapp_width, &dockapp_height, &dockapp_border, &dockapp_depth);
scale = (double) root_width / (double) dockapp_width;
+ aspect = (double) root_height / (double) dockapp_height;
*active_window = get_atom_long(active_window_atom, XA_WINDOW, dockapp_root);
*active_desktop = get_atom_long(current_desktop_atom, XA_CARDINAL, DefaultRootWindow(DADisplay));
}
(*clients)[i]->window = 0;
+ /* Don't page the pager. */
+ if (data[i] == DAWindow) continue;
+
/* Check the window is on our desktop (or all desktops). */
client_desktop = get_atom_long(client_desktop_atom, XA_CARDINAL, data[i]);
if (desktop > -1) {
/* Scale it. */
(*clients)[i]->rect.x = (double) x / scale;
- (*clients)[i]->rect.y = (double) y / scale;
+ (*clients)[i]->rect.y = (double) y / aspect;
(*clients)[i]->rect.width = (double) width / scale;
- (*clients)[i]->rect.height = (double) height / scale;
+ (*clients)[i]->rect.height = (double) height / aspect;
}
XFree(data);
Display *display;
unsigned int root_width, root_height;
long num_desktops;
- double aspect;
DACallbacks callbacks = { 0, change, release, move, 0, 0, page };
DAProgramOption options = { "-d", "--desktop", "Desktop to page", DOInteger, 0, { (int *) &desktop } };
setup_atom(&active_window_atom, "_NET_ACTIVE_WINDOW");
setup_atom(&moveresize_window_atom, "_NET_MOVERESIZE_WINDOW");
- setup_atom(&above_state, "_NET_WM_STATE_ABOVE");
- setup_atom(&below_state, "_NET_WM_STATE_BELOW");
setup_atom(&shaded_state, "_NET_WM_STATE_SHADED");
setup_atom(&skip_pager_state, "_NET_WM_STATE_SKIP_PAGER");
setup_atom(&hidden_state, "_NET_WM_STATE_HIDDEN");