<name>desktop 2</name>
-->
</names>
+ <popupTime>500</popupTime>
+ <!-- The number of milliseconds to show the popup for when switching
+ desktops. Set this to 0 to disable the popup. -->
</desktops>
<resize>
<doubleClickTime>200</doubleClickTime>
<!-- in milliseconds (1000 = 1 second) -->
<screenEdgeWarpTime>400</screenEdgeWarpTime>
- <!-- time before changing desktops when the pointer touches the edge of the
- screen while moving a window, in milliseconds (1000 = 1 second),
- 0 disables warping -->
+ <!-- Time before changing desktops when the pointer touches the edge of the
+ screen while moving a window, in milliseconds (1000 = 1 second).
+ Set this to 0 to disable warping -->
<context name="Frame">
<mousebind button="A-Left" action="Press">
<xsd:element maxOccurs="unbounded" name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
+ <xsd:element minOccurs="0" name="popupTime" type="xsd:integer"/>
</xsd:complexType>
<xsd:complexType name="resize">
<xsd:element minOccurs="0" name="drawContents" type="ob:bool"/>
d = o->abs.desktop;
break;
case RELATIVE:
- d = screen_cycle_desktop(o->rel.dir,
- o->rel.wrap,
- o->rel.linear,
- FALSE, TRUE, FALSE);
+ d = screen_find_desktop(screen_desktop,
+ o->rel.dir, o->rel.wrap, o->rel.linear);
break;
}
gint config_desktops_num;
GSList *config_desktops_names;
guint config_screen_firstdesk;
+guint config_desktop_popup_time;
gboolean config_resize_redraw;
gboolean config_resize_four_corners;
if ((n = parse_find_node("followMouse", node)))
config_focus_follow = parse_bool(doc, n);
if ((n = parse_find_node("focusDelay", node)))
- config_focus_delay = parse_int(doc, n) * 1000;
+ config_focus_delay = parse_int(doc, n);
if ((n = parse_find_node("raiseOnFocus", node)))
config_focus_raise = parse_bool(doc, n);
if ((n = parse_find_node("focusLast", node)))
nname = parse_find_node("name", nname->next);
}
}
+ if ((n = parse_find_node("popupTime", node)))
+ config_desktop_popup_time = parse_int(doc, n);
}
static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
if ((n = parse_find_node("autoHide", node)))
config_dock_hide = parse_bool(doc, n);
if ((n = parse_find_node("hideDelay", node)))
- config_dock_hide_delay = parse_int(doc, n) * 1000;
+ config_dock_hide_delay = parse_int(doc, n);
if ((n = parse_find_node("showDelay", node)))
- config_dock_show_delay = parse_int(doc, n) * 1000;
+ config_dock_show_delay = parse_int(doc, n);
if ((n = parse_find_node("moveButton", node))) {
gchar *str = parse_string(doc, n);
guint b, s;
config_desktops_num = 4;
config_screen_firstdesk = 1;
config_desktops_names = NULL;
+ config_desktop_popup_time = 500;
parse_register(i, "desktops", parse_desktops, NULL);
extern gboolean config_focus_new;
/*! Focus windows when the mouse enters them */
extern gboolean config_focus_follow;
-/*! Timeout for focusing windows on focus follows mouse, in microseconds */
+/*! Timeout for focusing windows on focus follows mouse, in milliseconds */
extern guint config_focus_delay;
/*! If windows should automatically be raised when they are focused in
focus follows mouse */
extern ObOrientation config_dock_orient;
/*! Whether to auto-hide the dock when the pointer is not over it */
extern gboolean config_dock_hide;
-/*! The number of microseconds to wait before hiding the dock */
+/*! The number of milliseconds to wait before hiding the dock */
extern guint config_dock_hide_delay;
-/*! The number of microseconds to wait before showing the dock */
+/*! The number of milliseconds to wait before showing the dock */
extern guint config_dock_show_delay;
/*! The mouse button to be used to move dock apps */
extern guint config_dock_app_move_button;
extern guint config_screen_firstdesk;
/*! Names for the desktops */
extern GSList *config_desktops_names;
+/*! Amount of time to show the desktop switch dialog */
+extern guint config_desktop_popup_time;
/*! The keycode of the key combo which resets the keybaord chains */
extern guint config_keyboard_reset_keycode;
/*! Number of pixels to resist while crossing a screen's edge */
extern gint config_resist_edge;
-/*! delay for hiding menu when opening */
+/*! Delay for hiding menu when opening in milliseconds */
extern guint config_menu_hide_delay;
/*! Center menus vertically about the parent entry */
extern gboolean config_menu_middle;
-/*! delay before opening a submenu */
+/*! Delay before opening a submenu in milliseconds */
extern guint config_submenu_show_delay;
/*! show icons in client_list_menu */
extern gboolean config_menu_client_list_icons;
{
if (!hide) {
if (dock->hidden && config_dock_hide) {
- ob_main_loop_timeout_add(ob_main_loop, config_dock_show_delay,
- show_timeout, NULL, g_direct_equal, NULL);
+ ob_main_loop_timeout_add(ob_main_loop,
+ config_dock_show_delay * 1000,
+ show_timeout, NULL, g_direct_equal, NULL);
} else if (!dock->hidden && config_dock_hide) {
ob_main_loop_timeout_remove(ob_main_loop, hide_timeout);
}
} else {
if (!dock->hidden && config_dock_hide) {
- ob_main_loop_timeout_add(ob_main_loop, config_dock_hide_delay,
- hide_timeout, NULL, g_direct_equal, NULL);
+ ob_main_loop_timeout_add(ob_main_loop,
+ config_dock_hide_delay * 1000,
+ hide_timeout, NULL, g_direct_equal, NULL);
} else if (dock->hidden && config_dock_hide) {
ob_main_loop_timeout_remove(ob_main_loop, show_timeout);
}
data->time = event_curtime;
ob_main_loop_timeout_add(ob_main_loop,
- config_focus_delay,
+ config_focus_delay * 1000,
focus_delay_func,
data, focus_delay_cmp, focus_delay_dest);
} else {
#include "startupnotify.h"
#include "moveresize.h"
#include "config.h"
+#include "mainloop.h"
#include "screen.h"
#include "client.h"
#include "session.h"
static GSList *struts_right = NULL;
static GSList *struts_bottom = NULL;
-static ObPagerPopup *desktop_cycle_popup;
+static ObPagerPopup *desktop_popup;
static gboolean replace_wm()
{
guint32 d;
gboolean namesexist = FALSE;
- desktop_cycle_popup = pager_popup_new(FALSE);
- pager_popup_height(desktop_cycle_popup, POPUP_HEIGHT);
+ desktop_popup = pager_popup_new(FALSE);
+ pager_popup_height(desktop_popup, POPUP_HEIGHT);
if (reconfig) {
/* update the pager popup's width */
- pager_popup_text_width_to_strings(desktop_cycle_popup,
+ pager_popup_text_width_to_strings(desktop_popup,
screen_desktop_names,
screen_num_desktops);
return;
void screen_shutdown(gboolean reconfig)
{
- pager_popup_free(desktop_cycle_popup);
+ pager_popup_free(desktop_popup);
if (reconfig)
return;
if (event_curtime != CurrentTime)
screen_desktop_user_time = event_curtime;
+
+ if (ob_state() == OB_STATE_RUNNING)
+ screen_show_desktop_popup(screen_desktop);
}
void screen_add_desktop(gboolean current)
return 0;
}
-void screen_desktop_popup(guint d, gboolean show)
+static gboolean hide_desktop_popup_func(gpointer data)
+{
+ pager_popup_hide(desktop_popup);
+ return FALSE; /* don't repeat */
+}
+
+void screen_show_desktop_popup(guint d)
{
Rect *a;
- if (!show) {
- pager_popup_hide(desktop_cycle_popup);
- } else {
- a = screen_physical_area_active();
- 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);
- }
+ /* 0 means don't show the popup */
+ if (!config_desktop_popup_time) return;
+
+ a = screen_physical_area_active();
+ pager_popup_position(desktop_popup, CenterGravity,
+ a->x + a->width / 2, a->y + a->height / 2);
+ pager_popup_icon_size_multiplier(desktop_popup,
+ (screen_desktop_layout.columns /
+ screen_desktop_layout.rows) / 2,
+ (screen_desktop_layout.rows/
+ screen_desktop_layout.columns) / 2);
+ pager_popup_max_width(desktop_popup,
+ MAX(a->width/3, POPUP_WIDTH));
+ pager_popup_show(desktop_popup, screen_desktop_names[d], d);
+
+ ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func);
+ ob_main_loop_timeout_add(ob_main_loop, config_desktop_popup_time * 1000,
+ hide_desktop_popup_func, NULL, NULL, NULL);
}
guint screen_find_desktop(guint from, ObDirection dir,
return d;
}
-guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
- gboolean dialog, gboolean done, gboolean cancel)
-{
- static guint d = (guint)-1;
- guint ret;
-
- if (d == (guint)-1)
- d = screen_desktop;
-
- if ((!cancel && !done) || !dialog)
- d = screen_find_desktop(d, dir, wrap, linear);
-
- if (dialog && !cancel && !done)
- screen_desktop_popup(d, TRUE);
- else
- screen_desktop_popup(0, FALSE);
- ret = d;
-
- if (!dialog || cancel || done)
- d = (guint)-1;
-
- return ret;
-}
-
static gboolean screen_validate_layout(ObDesktopLayout *l)
{
if (l->columns == 0 && l->rows == 0) /* both 0's is bad data.. */
}
/* resize the pager for these names */
- pager_popup_text_width_to_strings(desktop_cycle_popup,
+ pager_popup_text_width_to_strings(desktop_popup,
screen_desktop_names,
screen_num_desktops);
}
/*! Remove a desktop, either at the end or the current desktop */
void screen_remove_desktop(gboolean current);
-/*! Interactively change desktops */
-guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
- gboolean dialog, gboolean done, gboolean cancel);
-
guint screen_find_desktop(guint from, ObDirection dir,
gboolean wrap, gboolean linear);
-/*! Show/hide the desktop popup (pager) for the given desktop */
-void screen_desktop_popup(guint d, gboolean show);
+/*! Show the desktop popup/notification */
+void screen_show_desktop_popup(guint d);
/*! Shows and focuses the desktop and hides all the client windows, or
returns to the normal state, showing client windows.