merge r6667-6672 from trunk
authorDana Jansens <danakj@orodu.net>
Sun, 20 May 2007 15:28:18 +0000 (15:28 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 20 May 2007 15:28:18 +0000 (15:28 +0000)
doc/openbox.1.in
doc/openbox.1.sgml
openbox/client.c
openbox/config.c
openbox/config.h
openbox/frame.c
openbox/openbox.c
openbox/place.c
render/theme.c

index f419db1..5b5d4ad 100644 (file)
@@ -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 
index 2e0c3c8..6921a66 100644 (file)
@@ -40,6 +40,7 @@ manpage.1: manpage.sgml
       <arg><option>--version</option></arg>
       <arg><option>--replace</option></arg>
       <arg><option>--reconfigure</option></arg>
+      <arg><option>--restart</option></arg>
       <arg><option>--sm-disable</option></arg>
       <arg><option>--sync</option></arg>
       <arg><option>--debug</option></arg>
@@ -128,6 +129,14 @@ manpage.1: manpage.sgml
         </listitem>
       </varlistentry>
       <varlistentry>
+        <term><option>--restart</option></term>
+        <listitem>
+          <para>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.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
         <term><option>--sm-disable</option></term>
         <listitem>
           <para>Do not connect to the session manager.</para>
index 0dd1221..e77a4ea 100644 (file)
@@ -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);
index 6a45005..c007de5 100644 (file)
@@ -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;
index 6a0ee33..a1598b8 100644 (file)
@@ -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 */
index ca66821..ae91e6e 100644 (file)
@@ -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);
index ec5c7db..f66f6a7 100644 (file)
@@ -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 */
index 214bb59..99257bf 100644 (file)
@@ -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 */
index 2d20855..2566f30 100644 (file)
@@ -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))