X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=dddb788f1352d469a1146dc62c9e361b8b5f452a;hb=3537e50141f7bd38012e08b68b43d76a146e83dc;hp=ffbe7124ddaa3d6c1d45891291af6ffedd11dae4;hpb=ebabf3943c926547739254fb67f8024166ea000f;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index ffbe7124..dddb788f 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -273,7 +273,10 @@ gboolean screen_annex(const gchar *program_name) supported[i++] = prop_atoms.net_moveresize_window; supported[i++] = prop_atoms.net_wm_moveresize; supported[i++] = prop_atoms.net_wm_user_time; + supported[i++] = prop_atoms.net_wm_user_time_window; supported[i++] = prop_atoms.net_frame_extents; + supported[i++] = prop_atoms.net_request_frame_extents; + supported[i++] = prop_atoms.net_restack_window; supported[i++] = prop_atoms.net_startup_id; #ifdef SYNC supported[i++] = prop_atoms.net_wm_sync_request; @@ -438,7 +441,7 @@ void screen_set_num_desktops(guint num) for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; if (c->desktop >= num && c->desktop != DESKTOP_ALL) - client_set_desktop(c, num - 1, FALSE, FALSE); + client_set_desktop(c, num - 1, FALSE); } /* change our struts/area to match (after moving windows) */ @@ -473,7 +476,7 @@ void screen_set_desktop(guint num, gboolean dofocus) ob_debug("Moving to desktop %d\n", num+1); if (moveresize_client) - client_set_desktop(moveresize_client, num, TRUE, FALSE); + client_set_desktop(moveresize_client, num, TRUE); /* show windows before hiding the rest to lessen the enter/leave events */ @@ -498,7 +501,7 @@ void screen_set_desktop(guint num, gboolean dofocus) if (c->can_focus) { /* do this here so that if you switch desktops to a window with helper windows then the helper windows won't flash */ - client_bring_non_application_windows(c); + client_bring_helper_windows(c); /* reduce flicker by hiliting now rather than waiting for the server FocusIn event */ frame_adjust_focus(c->frame, TRUE); @@ -638,6 +641,11 @@ void screen_desktop_popup(guint d, gboolean show) a = screen_physical_area_monitor(0); pager_popup_position(desktop_cycle_popup, CenterGravity, a->x + a->width / 2, a->y + a->height / 2); + pager_popup_icon_size_multiplier(desktop_cycle_popup, + (screen_desktop_layout.columns / + screen_desktop_layout.rows) / 2, + (screen_desktop_layout.rows/ + screen_desktop_layout.columns) / 2); pager_popup_max_width(desktop_cycle_popup, MAX(a->width/3, POPUP_WIDTH)); pager_popup_show(desktop_cycle_popup, screen_desktop_names[d], d); @@ -647,20 +655,15 @@ void screen_desktop_popup(guint d, gboolean show) guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear, gboolean dialog, gboolean done, gboolean cancel) { - static gboolean first = TRUE; - static guint origd, d; guint r, c; + static guint d = (guint)-1; + guint ret; - if (cancel) { - d = origd; - goto done_cycle; - } else if (done && dialog) { - goto done_cycle; - } - if (first) { - first = FALSE; - d = origd = screen_desktop; - } + if (d == (guint)-1) + d = screen_desktop; + + if ((cancel || done) && dialog) + goto show_cycle_dialog; get_row_col(d, &r, &c); @@ -773,17 +776,16 @@ guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear, } show_cycle_dialog: - if (dialog) { + if (dialog && !cancel && !done) { screen_desktop_popup(d, TRUE); - return d; - } + } else + screen_desktop_popup(0, FALSE); + ret = d; -done_cycle: - first = TRUE; + if (!dialog || cancel || done) + d = (guint)-1; - screen_desktop_popup(0, FALSE); - - return d; + return ret; } void screen_update_layout() @@ -1267,7 +1269,16 @@ gboolean screen_pointer_pos(gint *x, gint *y) Window w; gint i; guint u; - - return !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen), - &w, &w, x, y, &i, &i, &u); + gboolean ret; + + ret = !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen), + &w, &w, x, y, &i, &i, &u); + if (!ret) { + for (i = 0; i < ScreenCount(ob_display); ++i) + if (i != ob_screen) + if (XQueryPointer(ob_display, RootWindow(ob_display, i), + &w, &w, x, y, &i, &i, &u)) + break; + } + return ret; }