From 177f828908117df79f00e73309b8bc3378874f8b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 20 May 2007 15:28:18 +0000 Subject: [PATCH] merge r6667-6672 from trunk --- doc/openbox.1.in | 8 ++++++-- doc/openbox.1.sgml | 9 +++++++++ openbox/client.c | 4 +++- openbox/config.c | 2 -- openbox/config.h | 2 -- openbox/frame.c | 20 +++++++++++++------- openbox/openbox.c | 3 +-- openbox/place.c | 20 +++++++++++++++++--- render/theme.c | 24 +++++++++++++++++++----- 9 files changed, 68 insertions(+), 24 deletions(-) diff --git a/doc/openbox.1.in b/doc/openbox.1.in index f419db14..5b5d4ade 100644 --- a/doc/openbox.1.in +++ b/doc/openbox.1.in @@ -4,7 +4,7 @@ openbox \(em A minimalistic, highly configurable, next generation window manager with extensive standards support. .SH "SYNOPSIS" .PP -\fBopenbox\fR [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-replace\fP] [\fB\-\-reconfigure\fP] [\fB\-\-sm-disable\fP] [\fB\-\-sync\fP] [\fB\-\-debug\fP] [\fB\-\-debug-focus\fP] [\fB\-\-debug-xinerama\fP] +\fBopenbox\fR [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-replace\fP] [\fB\-\-reconfigure\fP] [\fB\-\-restart\fP] [\fB\-\-sm-disable\fP] [\fB\-\-sync\fP] [\fB\-\-debug\fP] [\fB\-\-debug-focus\fP] [\fB\-\-debug-xinerama\fP] .SH "DESCRIPTION" .PP Openbox is minimalistic, highly configurable, next generation window @@ -66,6 +66,10 @@ Replace the currently running window manager. .IP "\fB\-\-reconfigure\fP" 10 If Openbox is already running on the display, tell it to reload its configuration. +.IP "\fB\-\-restart\fP" 10 +If Openbox is already running on the display, tell it to +restart. This is useful if you have upgraded Openbox and don't +want to restart X. .IP "\fB\-\-sm-disable\fP" 10 Do not connect to the session manager. .IP "\fB\-\-sync\fP" 10 @@ -88,4 +92,4 @@ The program's full documentation is available on the website: .PP Please report bugs to: \fBhttp://bugzilla.icculus.org/ \fP -.\" created by instant / docbook-to-man, Sat 19 May 2007, 16:56 +.\" created by instant / docbook-to-man, Sun 20 May 2007, 11:29 diff --git a/doc/openbox.1.sgml b/doc/openbox.1.sgml index 2e0c3c83..6921a666 100644 --- a/doc/openbox.1.sgml +++ b/doc/openbox.1.sgml @@ -40,6 +40,7 @@ manpage.1: manpage.sgml + @@ -127,6 +128,14 @@ manpage.1: manpage.sgml reload its configuration. + + + + If Openbox is already running on the display, tell it to + restart. This is useful if you have upgraded Openbox and don't + want to restart X. + + diff --git a/openbox/client.c b/openbox/client.c index 0dd12214..e77a4ea6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -853,9 +853,11 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, gint ox = *x, oy = *y; gboolean rudel = rude, ruder = rude, rudet = rude, rudeb = rude; gint fw, fh; + Rect desired; + RECT_SET(desired, *x, *y, w, h); all_a = screen_area(self->desktop); - mon_a = screen_area_monitor(self->desktop, client_monitor(self)); + mon_a = screen_area_monitor(self->desktop, screen_find_monitor(&desired)); /* get where the frame would be */ frame_client_gravity(self->frame, x, y, w, h); diff --git a/openbox/config.c b/openbox/config.c index 6a45005d..c007de53 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -77,7 +77,6 @@ guint config_keyboard_reset_state; gint config_mouse_threshold; gint config_mouse_dclicktime; -gboolean config_menu_warppointer; guint config_menu_hide_delay; gboolean config_menu_middle; guint config_submenu_show_delay; @@ -882,7 +881,6 @@ void config_startup(ObParseInst *i) parse_register(i, "resistance", parse_resistance, NULL); - config_menu_warppointer = TRUE; config_menu_hide_delay = 250; config_menu_middle = FALSE; config_submenu_show_delay = 0; diff --git a/openbox/config.h b/openbox/config.h index 6a0ee33c..a1598b8c 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -150,8 +150,6 @@ extern gint config_resist_win; /*! Number of pixels to resist while crossing a screen's edge */ extern gint config_resist_edge; -/*! Warp near edge on menu? */ -extern gboolean config_menu_warppointer; /*! delay for hiding menu when opening */ extern guint config_menu_hide_delay; /*! Center menus vertically about the parent entry */ diff --git a/openbox/frame.c b/openbox/frame.c index ca66821a..ae91e6e8 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -295,18 +295,20 @@ void frame_adjust_shape(ObFrame *self) num = 0; if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { - xrect[0].x = -ob_rr_theme->fbwidth; - xrect[0].y = -ob_rr_theme->fbwidth; - xrect[0].width = self->width + self->bwidth * 2; + xrect[0].x = 0; + xrect[0].y = 0; + xrect[0].width = self->area.width; xrect[0].height = ob_rr_theme->title_height + - self->bwidth * 2; + self->bwidth + self->rbwidth; ++num; } - if (self->decorations & OB_FRAME_DECOR_HANDLE) { - xrect[1].x = -ob_rr_theme->fbwidth; + if (self->decorations & OB_FRAME_DECOR_HANDLE && + ob_rr_theme->handle_height > 0) + { + xrect[1].x = 0; xrect[1].y = FRAME_HANDLE_Y(self); - xrect[1].width = self->width + self->bwidth * 2; + xrect[1].width = self->area.width; xrect[1].height = ob_rr_theme->handle_height + self->bwidth * 2; ++num; @@ -419,6 +421,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved, } else XUnmapWindow(ob_display, self->titlebottom); } else { + XUnmapWindow(ob_display, self->titlebottom); + XUnmapWindow(ob_display, self->titletop); XUnmapWindow(ob_display, self->titletopleft); XUnmapWindow(ob_display, self->titletopright); @@ -579,6 +583,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved, } else XUnmapWindow(ob_display, self->handletop); } else { + XUnmapWindow(ob_display, self->handletop); + XUnmapWindow(ob_display, self->handlebottom); XUnmapWindow(ob_display, self->lgripleft); XUnmapWindow(ob_display, self->rgripright); diff --git a/openbox/openbox.c b/openbox/openbox.c index ec5c7db2..f66f6a76 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -477,6 +477,7 @@ static void print_help() g_print(_(" --sm-disable Disable connection to the session manager\n")); g_print(_("\nPassing messages to a running Openbox instance:\n")); g_print(_(" --reconfigure Reload Openbox's configuration\n")); + g_print(_(" --restart Restart Openbox\n")); g_print(_("\nDebugging options:\n")); g_print(_(" --sync Run in synchronous mode\n")); g_print(_(" --debug Display debugging output\n")); @@ -542,10 +543,8 @@ static void parse_args(gint *argc, gchar **argv) } else if (!strcmp(argv[i], "--reconfigure")) { remote_control = 1; -/* don't make this do anything if it's not in --help .. } else if (!strcmp(argv[i], "--restart")) { remote_control = 2; -*/ } else if (!strcmp(argv[i], "--sm-save-file")) { if (i == *argc - 1) /* no args left */ diff --git a/openbox/place.c b/openbox/place.c index 214bb59c..99257bf1 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -23,6 +23,7 @@ #include "frame.h" #include "focus.h" #include "config.h" +#include "debug.h" static void add_choice(guint *choice, guint mychoice) { @@ -70,6 +71,8 @@ static Rect **pick_head(ObClient *c) /* try direct parent first */ if (c->transient_for && c->transient_for != OB_TRAN_GROUP) { add_choice(choice, client_monitor(c->transient_for)); + ob_debug("placement adding choice %d for parent\n", + client_monitor(c->transient_for)); } /* more than one window in its group (more than just this window) */ @@ -82,25 +85,36 @@ static Rect **pick_head(ObClient *c) if (itc != c && (itc->desktop == c->desktop || itc->desktop == DESKTOP_ALL || c->desktop == DESKTOP_ALL)) + { add_choice(choice, client_monitor(it->data)); + ob_debug("placement adding choice %d for group sibling\n", + client_monitor(it->data)); + } } /* try on all desktops */ for (it = c->group->members; it; it = g_slist_next(it)) { ObClient *itc = it->data; - if (itc != c) + if (itc != c) { add_choice(choice, client_monitor(it->data)); + ob_debug("placement adding choice %d for group sibling on " + "another desktop\n", client_monitor(it->data)); + } } } - if (focus_client) + if (focus_client) { add_choice(choice, client_monitor(focus_client)); + ob_debug("placement adding choice %d for focused window\n", + client_monitor(focus_client)); + } screen_pointer_pos(&px, &py); for (i = 0; i < screen_num_monitors; i++) if (RECT_CONTAINS(*screen_physical_area_monitor(i), px, py)) { add_choice(choice, i); + ob_debug("placement adding choice %d for mouse pointer\n", i); break; } @@ -276,7 +290,7 @@ static gboolean place_smart(ObClient *client, gint *x, gint *y, areas = pick_head(client); - for (i = 0; i < screen_num_monitors; ++i) { + for (i = 0; i < screen_num_monitors && !ret; ++i) { spaces = area_add(spaces, areas[i]); /* stay out from under windows in higher layers */ diff --git a/render/theme.c b/render/theme.c index 2d208552..2566f307 100644 --- a/render/theme.c +++ b/render/theme.c @@ -56,6 +56,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, gchar *str; RrTheme *theme; gchar *path; + gboolean userdef; theme = g_new0(RrTheme, 1); @@ -339,15 +340,21 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, /* load the image masks */ /* maximize button masks */ + userdef = TRUE; if (!read_mask(inst, path, theme, "max.xbm", &theme->max_mask)) { guchar data[] = { 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f }; theme->max_mask = RrPixmapMaskNew(inst, 6, 6, (gchar*)data); - } + userdef = FALSE; + } if (!read_mask(inst, path, theme, "max_toggled.xbm", &theme->max_toggled_mask)) { - guchar data[] = { 0x3e, 0x22, 0x2f, 0x29, 0x39, 0x0f }; - theme->max_toggled_mask = RrPixmapMaskNew(inst, 6, 6,(gchar*)data); + if (userdef) + theme->max_toggled_mask = RrPixmapMaskCopy(theme->max_mask); + else { + guchar data[] = { 0x3e, 0x22, 0x2f, 0x29, 0x39, 0x0f }; + theme->max_toggled_mask = RrPixmapMaskNew(inst, 6, 6,(gchar*)data); + } } if (!read_mask(inst, path, theme, "max_pressed.xbm", &theme->max_pressed_mask)) @@ -382,14 +389,21 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, theme->iconify_hover_mask = RrPixmapMaskCopy(theme->iconify_mask); /* all desktops button masks */ + userdef = TRUE; if (!read_mask(inst, path, theme, "desk.xbm", &theme->desk_mask)) { guchar data[] = { 0x33, 0x33, 0x00, 0x00, 0x33, 0x33 }; theme->desk_mask = RrPixmapMaskNew(inst, 6, 6, (gchar*)data); + userdef = FALSE; } if (!read_mask(inst, path, theme, "desk_toggled.xbm", &theme->desk_toggled_mask)) { - guchar data[] = { 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 }; - theme->desk_toggled_mask = RrPixmapMaskNew(inst, 6, 6, (gchar*)data); + if (userdef) + theme->desk_toggled_mask = RrPixmapMaskCopy(theme->desk_mask); + else { + guchar data[] = { 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 }; + theme->desk_toggled_mask = + RrPixmapMaskNew(inst, 6, 6, (gchar*)data); + } } if (!read_mask(inst, path, theme, "desk_pressed.xbm", &theme->desk_pressed_mask)) -- 2.34.1