From 264edb053dcf5cc5b2043bb1b34ac6f116fc4c8c Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 29 Mar 2009 22:34:50 +0200 Subject: Avoid anonymous unions Some compilers, like sun studio and clang don't support them. --- openbox/actions/desktop.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'openbox') diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 203936d9..07416151 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -21,7 +21,7 @@ typedef struct { gboolean wrap; ObDirection dir; } rel; - }; + } u; gboolean send; gboolean follow; } Options; @@ -49,9 +49,9 @@ static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, o = g_new0(Options, 1); /* don't go anywhere if theres no options given */ o->type = ABSOLUTE; - o->abs.desktop = screen_desktop; + o->u.abs.desktop = screen_desktop; /* wrap by default - it's handy! */ - o->rel.wrap = TRUE; + o->u.rel.wrap = TRUE; if ((n = parse_find_node("to", node))) { gchar *s = parse_string(doc, n); @@ -59,43 +59,43 @@ static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, o->type = LAST; else if (!g_ascii_strcasecmp(s, "next")) { o->type = RELATIVE; - o->rel.linear = TRUE; - o->rel.dir = OB_DIRECTION_EAST; + o->u.rel.linear = TRUE; + o->u.rel.dir = OB_DIRECTION_EAST; } else if (!g_ascii_strcasecmp(s, "previous")) { o->type = RELATIVE; - o->rel.linear = TRUE; - o->rel.dir = OB_DIRECTION_WEST; + o->u.rel.linear = TRUE; + o->u.rel.dir = OB_DIRECTION_WEST; } else if (!g_ascii_strcasecmp(s, "north") || !g_ascii_strcasecmp(s, "up")) { o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_NORTH; + o->u.rel.dir = OB_DIRECTION_NORTH; } else if (!g_ascii_strcasecmp(s, "south") || !g_ascii_strcasecmp(s, "down")) { o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_SOUTH; + o->u.rel.dir = OB_DIRECTION_SOUTH; } else if (!g_ascii_strcasecmp(s, "west") || !g_ascii_strcasecmp(s, "left")) { o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_WEST; + o->u.rel.dir = OB_DIRECTION_WEST; } else if (!g_ascii_strcasecmp(s, "east") || !g_ascii_strcasecmp(s, "right")) { o->type = RELATIVE; - o->rel.dir = OB_DIRECTION_EAST; + o->u.rel.dir = OB_DIRECTION_EAST; } else { o->type = ABSOLUTE; - o->abs.desktop = atoi(s) - 1; + o->u.abs.desktop = atoi(s) - 1; } g_free(s); } if ((n = parse_find_node("wrap", node))) - o->rel.wrap = parse_bool(doc, n); + o->u.rel.wrap = parse_bool(doc, n); return o; } @@ -127,11 +127,11 @@ static gboolean run_func(ObActionsData *data, gpointer options) d = screen_last_desktop; break; case ABSOLUTE: - d = o->abs.desktop; + d = o->u.abs.desktop; break; case RELATIVE: d = screen_find_desktop(screen_desktop, - o->rel.dir, o->rel.wrap, o->rel.linear); + o->u.rel.dir, o->u.rel.wrap, o->u.rel.linear); break; } -- cgit v1.2.3 From 82db73cc4344cf4e8a3757fb1ec50be77e3bc9d8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 3 Jul 2009 21:19:54 +0200 Subject: Fix for #3715, app settings applied too late. This caused problems for placing windows with decor turned off, the placement code thought they had it on. --- openbox/client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index 03bbfe48..016a660f 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -315,6 +315,11 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0); ob_debug("Window name: %s class: %s\n", self->name, self->class); + /* per-app settings override stuff from client_get_all, and return the + settings for other uses too. the returned settings is a shallow copy, + that needs to be freed with g_free(). */ + settings = client_get_settings_state(self); + /* now we have all of the window's information so we can set this up. do this before creating the frame, so it can tell that we are still mapping and doesn't go applying things right away */ @@ -335,10 +340,6 @@ void client_manage(Window window, ObPrompt *prompt) time now */ grab_server(FALSE); - /* per-app settings override stuff from client_get_all, and return the - settings for other uses too. the returned settings is a shallow copy, - that needs to be freed with g_free(). */ - settings = client_get_settings_state(self); /* the session should get the last say though */ client_restore_session_state(self); -- cgit v1.2.3 From 75ca8467921f68fdbd6100a1a435a410ef31acb0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 3 Jul 2009 21:20:30 +0200 Subject: Show window role in the debug message for name/class too. --- openbox/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index 016a660f..789a0347 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -313,7 +313,7 @@ void client_manage(Window window, ObPrompt *prompt) ob_debug("Window type: %d\n", self->type); ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0); - ob_debug("Window name: %s class: %s\n", self->name, self->class); + ob_debug("Window name: %s class: %s role: %s\n", self->name, self->class, self->role); /* per-app settings override stuff from client_get_all, and return the settings for other uses too. the returned settings is a shallow copy, -- cgit v1.2.3 From d48e720c3977d1d64620108589380919b430affe Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 3 Jul 2009 18:58:21 -0400 Subject: client_validate should return FALSE only for UnmapNotifies that will cause the window to become unmanaged --- openbox/client.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/client.c b/openbox/client.c index 789a0347..c1af196b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3591,18 +3591,38 @@ ObClient *client_search_modal_child(ObClient *self) return NULL; } +static gboolean client_validate_unmap(ObClient *self, int n) +{ + XEvent e; + gboolean ret = TRUE; + + if (XCheckTypedWindowEvent(ob_display, self->window, UnmapNotify, &e)) { + if (n < self->ignore_unmaps) // ignore this one, but look for more + ret = client_validate_unmap(self, n+1); + else + ret = FALSE; // the window is going to become unmanaged + + /* put them back on the event stack so they end up in the same order */ + XPutBackEvent(ob_display, &e); + } + + return ret; +} + gboolean client_validate(ObClient *self) { XEvent e; XSync(ob_display, FALSE); /* get all events on the server */ - if (XCheckTypedWindowEvent(ob_display, self->window, DestroyNotify, &e) || - XCheckTypedWindowEvent(ob_display, self->window, UnmapNotify, &e)) { + if (XCheckTypedWindowEvent(ob_display, self->window, DestroyNotify, &e)) { XPutBackEvent(ob_display, &e); return FALSE; } + if (!client_validate_unmap(self, 0)) + return FALSE; + return TRUE; } -- cgit v1.2.3 From 3cd4db67aa430c85af8ac88dc40e9cfa63cc246a Mon Sep 17 00:00:00 2001 From: Nico Golde Date: Sat, 4 Jul 2009 14:26:50 +0200 Subject: Add "prev" and "next" as possible targets for moveto/resizeto actions. One of the Debian users asked if it's possible to send a window to other monitor when using xinerama, especially useful of you have 2 monitors and want to toggle a window to the other one. I wrote a patch that implements next and prev to also make that work for 3 or more workspaces. --- openbox/actions/moveresizeto.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index cdd772ad..acad73b5 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -6,7 +6,9 @@ enum { CURRENT_MONITOR = -1, - ALL_MONITORS = -2 + ALL_MONITORS = -2, + NEXT_MONITOR = -3, + PREV_MONITOR = -4 }; typedef struct { @@ -89,6 +91,10 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) if (g_ascii_strcasecmp(s, "current") != 0) { if (!g_ascii_strcasecmp(s, "all")) o->monitor = ALL_MONITORS; + else if(!g_ascii_strcasecmp(s, "next")) + o->monitor = NEXT_MONITOR; + else if(!g_ascii_strcasecmp(s, "prev")) + o->monitor = PREV_MONITOR; else o->monitor = parse_int(doc, n) - 1; } @@ -121,6 +127,9 @@ static gboolean run_func(ObActionsData *data, gpointer options) cmon = client_monitor(c); if (mon == CURRENT_MONITOR) mon = cmon; else if (mon == ALL_MONITORS) mon = SCREEN_AREA_ALL_MONITORS; + else if (mon == NEXT_MONITOR) mon = (cmon + 1 > screen_num_monitors - 1) ? 0 : (cmon + 1); + else if (mon == PREV_MONITOR) mon = (cmon == 0) ? (screen_num_monitors - 1) : (cmon - 1); + area = screen_area(c->desktop, mon, NULL); carea = screen_area(c->desktop, cmon, NULL); -- cgit v1.2.3 From 384f2dfc48278998631d3f9bac3a337d296b198e Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 4 Jul 2009 15:34:54 +0200 Subject: Give the popup to the timer remove so it does the right one Only the chroot popup uses delayed mapping so this is just a latent bug. --- openbox/popup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/popup.c b/openbox/popup.c index 770f33d0..2a0d5960 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -320,7 +320,7 @@ void popup_hide(ObPopup *self) event_end_ignore_all_enters(ignore_start); } else if (self->delay_mapped) { - ob_main_loop_timeout_remove(ob_main_loop, popup_show_timeout); + ob_main_loop_timeout_remove_data(ob_main_loop, popup_show_timeout, self, FALSE); self->delay_mapped = FALSE; } } -- cgit v1.2.3 From 2e1adce628ee3234accc5d88cafb57672800cae0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 4 Jul 2009 16:58:02 +0200 Subject: Show desktop switch popup on every monitor This should be a satisfactory fix for #3694 I hope. --- openbox/screen.c | 103 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 31 deletions(-) (limited to 'openbox') diff --git a/openbox/screen.c b/openbox/screen.c index e908cf10..4913b606 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -77,7 +77,7 @@ static GSList *struts_left = NULL; static GSList *struts_right = NULL; static GSList *struts_bottom = NULL; -static ObPagerPopup *desktop_popup; +static ObPagerPopup **desktop_popup; /*! The number of microseconds that you need to be on a desktop before it will replace the remembered "last desktop" */ @@ -353,15 +353,22 @@ void screen_startup(gboolean reconfig) guint32 d; gboolean namesexist = FALSE; - desktop_popup = pager_popup_new(); - pager_popup_height(desktop_popup, POPUP_HEIGHT); - if (reconfig) { - /* update the pager popup's width */ - pager_popup_text_width_to_strings(desktop_popup, - screen_desktop_names, - screen_num_desktops); + guint i; + desktop_popup = g_new(ObPagerPopup*, screen_num_monitors); + for (i = 0; i < screen_num_monitors; i++) { + desktop_popup[i] = pager_popup_new(); + pager_popup_height(desktop_popup[i], POPUP_HEIGHT); + + /* update the pager popup's width */ + pager_popup_text_width_to_strings(desktop_popup[i], + screen_desktop_names, + screen_num_desktops); + } + return; + } else { + desktop_popup = NULL; } /* get the initial size */ @@ -451,7 +458,12 @@ void screen_startup(gboolean reconfig) void screen_shutdown(gboolean reconfig) { - pager_popup_free(desktop_popup); + guint i; + + for (i = 0; i < screen_num_monitors; i++) { + pager_popup_free(desktop_popup[i]); + } + g_free(desktop_popup); if (reconfig) return; @@ -922,39 +934,52 @@ static guint translate_row_col(guint r, guint c) static gboolean hide_desktop_popup_func(gpointer data) { - pager_popup_hide(desktop_popup); + guint i; + + for (i = 0; i < screen_num_monitors; i++) { + pager_popup_hide(desktop_popup[i]); + } return FALSE; /* don't repeat */ } void screen_show_desktop_popup(guint d) { Rect *a; + guint i; /* 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); - g_free(a); + for (i = 0; i < screen_num_monitors; i++) { + a = screen_physical_area_monitor(i); + pager_popup_position(desktop_popup[i], CenterGravity, + a->x + a->width / 2, a->y + a->height / 2); + pager_popup_icon_size_multiplier(desktop_popup[i], + (screen_desktop_layout.columns / + screen_desktop_layout.rows) / 2, + (screen_desktop_layout.rows/ + screen_desktop_layout.columns) / 2); + pager_popup_max_width(desktop_popup[i], + MAX(a->width/3, POPUP_WIDTH)); + pager_popup_show(desktop_popup[i], 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, desktop_popup[i], + g_direct_equal, NULL); + g_free(a); + } } void screen_hide_desktop_popup(void) { - ob_main_loop_timeout_remove(ob_main_loop, hide_desktop_popup_func); - pager_popup_hide(desktop_popup); + guint i; + + for (i = 0; i < screen_num_monitors; i++) { + ob_main_loop_timeout_remove_data(ob_main_loop, hide_desktop_popup_func, + desktop_popup[i], FALSE); + pager_popup_hide(desktop_popup[i]); + } } guint screen_find_desktop(guint from, ObDirection dir, @@ -1189,9 +1214,11 @@ void screen_update_desktop_names(void) } /* resize the pager for these names */ - pager_popup_text_width_to_strings(desktop_popup, - screen_desktop_names, - screen_num_desktops); + for (i = 0; i < screen_num_monitors; i++) { + pager_popup_text_width_to_strings(desktop_popup[i], + screen_desktop_names, + screen_num_desktops); + } } void screen_show_desktop(gboolean show, ObClient *show_only) @@ -1321,6 +1348,20 @@ void screen_update_areas(void) g_free(monitor_area); extensions_xinerama_screens(&monitor_area, &screen_num_monitors); + if (!desktop_popup) { + desktop_popup = g_new(ObPagerPopup*, screen_num_monitors); + for (i = 0; i < screen_num_monitors; i++) { + desktop_popup[i] = pager_popup_new(); + pager_popup_height(desktop_popup[i], POPUP_HEIGHT); + + if (screen_desktop_names) + /* update the pager popup's width */ + pager_popup_text_width_to_strings(desktop_popup[i], + screen_desktop_names, + screen_num_desktops); + } + } + /* set up the user-specified margins */ config_margins.top_start = RECT_LEFT(monitor_area[screen_num_monitors]); config_margins.top_end = RECT_RIGHT(monitor_area[screen_num_monitors]); -- cgit v1.2.3 From ec9fbf05df3ac807d60ae6af36236ffc6567bbdc Mon Sep 17 00:00:00 2001 From: Geoffrey Antos Date: Sun, 5 Jul 2009 13:14:24 +0200 Subject: Fix interpretation of struts with multiple screens According to the WM Specification, the left, top, right, and bottom fields are to be declared relative to the overall X screen dimensions, not the monitor dimensions. The example given in the spec (v1.3 or 1.4draft2) is: "Another example is a panel on a screen using the Xinerama extension. Assume that the set up uses two monitors, one running at 1280x1024 and the other to the right running at 1024x768, with the top edge of the two physical displays aligned. If the panel wants to fill the entire bottom edge of the smaller display with a panel 50 pixels tall, it should set a bottom strut of 306, with bottom_start_x of 1280, and bottom_end_x of 2303. Note that the strut is relative to the screen edge, and not the edge of the xinerama monitor." In my case, I have a 1680x1050 monitor to the left of a 1920x1200 monitor aligned at the top. I then have a gnome-panel along the bottom edge of the 1680x1050 monitor with a height of 24 pixels. xprop reports the following partial strut: _NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 1679 which is correct according to the spec. Gnome-panel is reserving the 150 pixels along the bottom that aren't visible on the screen plus the 25 it requests for itself. However, maximizing a window on this monitor leaves a gap of exactly 150 pixels between the bottom edge of the maximized window and the top edge of the panel. Also, when the 1680x1050 monitor is the primary monitor (id=1) then the _NET_WORKAREA property on the root window is also off by 150px for the same reason. This patch fixes the two issues I mentioned for exterior monitor edges. It doesn't attempt to account for "interior" monitor edges (i.e. a 'left' strut on monitor A when monitor B is directly to the left of monitor A) because it's not possible to do so with the current strut specification (see http://mail.gnome.org/archives/wm-spec-list/2004-March/msg00004.html for a discussion on this limitation) This could be avoided by having the partial strut atom contain a xinerama screen ID that the strut applies to, but unfortunately the discussion all those years ago never got anywhere. [ quoted from bug #3792 ] --- openbox/screen.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'openbox') diff --git a/openbox/screen.c b/openbox/screen.c index 4913b606..1bcda980 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1459,6 +1459,15 @@ void screen_update_areas(void) b = MAX(b, s->strut->bottom); } + if (l) l += RECT_LEFT (monitor_area[screen_num_monitors]) + - RECT_LEFT (monitor_area[i]); + if (t) t += RECT_TOP (monitor_area[screen_num_monitors]) + - RECT_TOP (monitor_area[i]); + if (r) r -= RECT_RIGHT (monitor_area[screen_num_monitors]) + - RECT_RIGHT (monitor_area[i]); + if (b) b -= RECT_BOTTOM(monitor_area[screen_num_monitors]) + - RECT_BOTTOM(monitor_area[i]); + /* based on these margins, set the work area for the monitor/desktop */ dims[(i * screen_num_desktops + j) * 4 + 0] += l; @@ -1599,28 +1608,32 @@ Rect* screen_area(guint desktop, guint head, Rect *search) if ((s->desktop == d || s->desktop == DESKTOP_ALL) && STRUT_LEFT_IN_SEARCH(s->strut, search) && !STRUT_LEFT_IGNORE(s->strut, us, search)) - l = MAX(l, al + s->strut->left); + l = MAX(l, RECT_LEFT(monitor_area[screen_num_monitors]) + + s->strut->left); } for (it = struts_top; it; it = g_slist_next(it)) { ObScreenStrut *s = it->data; if ((s->desktop == d || s->desktop == DESKTOP_ALL) && STRUT_TOP_IN_SEARCH(s->strut, search) && !STRUT_TOP_IGNORE(s->strut, us, search)) - t = MAX(t, at + s->strut->top); + t = MAX(t, RECT_TOP(monitor_area[screen_num_monitors]) + + s->strut->top); } for (it = struts_right; it; it = g_slist_next(it)) { ObScreenStrut *s = it->data; if ((s->desktop == d || s->desktop == DESKTOP_ALL) && STRUT_RIGHT_IN_SEARCH(s->strut, search) && !STRUT_RIGHT_IGNORE(s->strut, us, search)) - r = MIN(r, ar - s->strut->right); + r = MIN(r, RECT_RIGHT(monitor_area[screen_num_monitors]) + - s->strut->right); } for (it = struts_bottom; it; it = g_slist_next(it)) { ObScreenStrut *s = it->data; if ((s->desktop == d || s->desktop == DESKTOP_ALL) && STRUT_BOTTOM_IN_SEARCH(s->strut, search) && !STRUT_BOTTOM_IGNORE(s->strut, us, search)) - b = MIN(b, ab - s->strut->bottom); + b = MIN(b, RECT_BOTTOM(monitor_area[screen_num_monitors]) + - s->strut->bottom); } /* limit to this monitor */ -- cgit v1.2.3 From 85f39cd27e7ea0eec8bc78f6139092b44fda2dad Mon Sep 17 00:00:00 2001 From: Henning Bekel Date: Sun, 5 Jul 2009 13:38:25 +0200 Subject: Don't draw borders in fullscreen mode when keepBorder is on --- openbox/frame.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/frame.c b/openbox/frame.c index 5e60d11c..e4a64bd3 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -341,7 +341,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->shaded = self->client->shaded; if (self->decorations & OB_FRAME_DECOR_BORDER || - (self->client->undecorated && config_theme_keepborder)) + (self->client->undecorated && config_theme_keepborder + && !self->client->fullscreen)) self->bwidth = ob_rr_theme->fbwidth; else self->bwidth = 0; -- cgit v1.2.3 From 7351d86443539fd60267baed129601d923e88269 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 5 Jul 2009 14:24:14 +0200 Subject: Don't trust xinerama not to return NULL We check that xinerama is active already, but someone got a NULL here. --- openbox/extensions.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'openbox') diff --git a/openbox/extensions.c b/openbox/extensions.c index cd188dd0..23d3e0c8 100644 --- a/openbox/extensions.c +++ b/openbox/extensions.c @@ -85,7 +85,11 @@ void extensions_query_all(void) void extensions_xinerama_screens(Rect **xin_areas, guint *nxin) { guint i; - gint l, r, t, b; + gint n, l, r, t, b; +#ifdef XINERAMA + XineramaScreenInfo *info; +#endif + if (ob_debug_xinerama) { gint w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)); gint h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)); @@ -94,12 +98,9 @@ void extensions_xinerama_screens(Rect **xin_areas, guint *nxin) RECT_SET((*xin_areas)[0], 0, 0, w/2, h); RECT_SET((*xin_areas)[1], w/2, 0, w-(w/2), h); } - else #ifdef XINERAMA - if (extensions_xinerama) { - guint i; - gint n; - XineramaScreenInfo *info = XineramaQueryScreens(ob_display, &n); + else if (extensions_xinerama && + (info = XineramaQueryScreens(ob_display, &n))) { *nxin = n; *xin_areas = g_new(Rect, *nxin + 1); for (i = 0; i < *nxin; ++i) @@ -107,8 +108,8 @@ void extensions_xinerama_screens(Rect **xin_areas, guint *nxin) info[i].width, info[i].height); XFree(info); } - else #endif + else { *nxin = 1; *xin_areas = g_new(Rect, *nxin + 1); -- cgit v1.2.3 From fa4e09dd7e8b65234e833444f418e890a9185898 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 5 Jul 2009 15:53:29 +0200 Subject: Allow escaping _ in menu labels by putting __ Currently you can't mark anything that comes after the __ with _ to make that a shortcut. --- openbox/menu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'openbox') diff --git a/openbox/menu.c b/openbox/menu.c index 23a0527a..58b6280e 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -232,10 +232,13 @@ static gunichar parse_shortcut(const gchar *label, gboolean allow_shortcut, /* you have to use a printable ascii character for shortcuts don't allow space either, so you can have like "a _ b" */ - if (VALID_SHORTCUT(*(i+1))) { - shortcut = g_unichar_tolower(g_utf8_get_char(i+1)); - *position = i - *strippedlabel; - *always_show = TRUE; + if (VALID_SHORTCUT(*(i+1)) || *(i+1) == '_') { + /* Allow you to escape the first _ by putting __ */ + if (*(i+1) != '_') { + shortcut = g_unichar_tolower(g_utf8_get_char(i+1)); + *position = i - *strippedlabel; + *always_show = TRUE; + } /* remove the '_' from the string */ for (; *i != '\0'; ++i) -- cgit v1.2.3 From 2ed56873b6a51965ff8159f8e0bbf82324f194d8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 5 Jul 2009 16:21:28 +0200 Subject: Another debug message typo --- openbox/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/event.c b/openbox/event.c index 8eb612a1..ddd2e326 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -651,7 +651,7 @@ static void event_process(const XEvent *ec, gpointer data) else if (e->type == MappingNotify) { /* keyboard layout changes for modifier mapping changes. reload the modifier map, and rebind all the key bindings as appropriate */ - ob_debug("Kepboard map changed. Reloading keyboard bindings.\n"); + ob_debug("Keyboard map changed. Reloading keyboard bindings.\n"); ob_set_state(OB_STATE_RECONFIGURING); modkeys_shutdown(TRUE); modkeys_startup(TRUE); -- cgit v1.2.3 From ba1ac214dfdbc0539c922e84c2318c1bf2566c0c Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlenga Date: Mon, 8 Jun 2009 00:35:49 +0200 Subject: Remove newline from startupnotify description It doesn't look good in some places, e.g. WnckTasklist (gnome-panel) [ Also update translations -- Mikael ] --- openbox/startupnotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index e13aa55c..47c95da1 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -240,7 +240,7 @@ void sn_setup_spawn_environment(const gchar *program, const gchar *name, gchar *desc; const char *id; - desc = g_strdup_printf(_("Running %s\n"), program); + desc = g_strdup_printf(_("Running %s"), program); if (sn_launcher_context_get_initiated(sn_launcher)) { sn_launcher_context_unref(sn_launcher); -- cgit v1.2.3