merge r7464-65 from trunk
authorDana Jansens <danakj@orodu.net>
Sun, 10 Jun 2007 00:46:10 +0000 (00:46 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 10 Jun 2007 00:46:10 +0000 (00:46 +0000)
openbox/client.c
openbox/config.c
openbox/config.h
openbox/place.c

index c3e7ae6cee31e6a949a5b61b4482b6f0b9ca5663..634b5180c73ee0637044fcb3de07352458a6324a 100644 (file)
@@ -3986,6 +3986,11 @@ ObClient* client_under_pointer()
             if (WINDOW_IS_CLIENT(it->data)) {
                 ObClient *c = WINDOW_AS_CLIENT(it->data);
                 if (c->frame->visible &&
+                    /* check the desktop, this is done during desktop
+                       switching and windows are shown/hidden status is not
+                       reliable */
+                    (c->desktop == screen_desktop ||
+                     c->desktop == DESKTOP_ALL) &&
                     /* ignore all animating windows */
                     !frame_iconify_animating(c->frame) &&
                     RECT_CONTAINS(c->frame->area, x, y))
index e34bc158be876d0d035bf934e50c319e9c667ad7..10a60fb4b35743380113f065483c5b4875b81f22 100644 (file)
@@ -132,6 +132,8 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src,
         dst->pos_given = TRUE;
         dst->center_x = src->center_x;
         dst->center_y = src->center_y;
+        dst->opposite_x = src->opposite_x;
+        dst->opposite_y = src->opposite_y;
         dst->position.x = src->position.x;
         dst->position.y = src->position.y;
         dst->monitor = src->monitor;
@@ -208,7 +210,12 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
                             settings->center_x = TRUE;
                             x_pos_given = TRUE;
                         } else {
-                            settings->position.x = parse_int(doc, c);
+                            if (s[0] == '-')
+                                settings->opposite_x = TRUE;
+                            if (s[0] == '-' || s[0] == '+')
+                                settings->position.x = atoi(s+1);
+                            else
+                                settings->position.x = atoi(s);
                             x_pos_given = TRUE;
                         }
                         g_free(s);
@@ -221,7 +228,12 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
                             settings->center_y = TRUE;
                             settings->pos_given = TRUE;
                         } else {
-                            settings->position.y = parse_int(doc, c);
+                            if (s[0] == '-')
+                                settings->opposite_y = TRUE;
+                            if (s[0] == '-' || s[0] == '+')
+                                settings->position.y = atoi(s+1);
+                            else
+                                settings->position.y = atoi(s);
                             settings->pos_given = TRUE;
                         }
                         g_free(s);
index 0a4ad090855b6827ce86f436983e7d5f207d2111..f45196e29d8b59c054d6ff02cd82203768f21121 100644 (file)
@@ -41,6 +41,8 @@ struct _ObAppSettings
     Point position;
     gboolean center_x;
     gboolean center_y;
+    gboolean opposite_x;
+    gboolean opposite_y;
     gboolean pos_given;
 
     guint desktop;
index 8f4726f62eda3bfdff920bf48d644d7b9b896ef4..0b8309a22ba74d6c867c1b673c27022ad60f101c 100644 (file)
@@ -432,11 +432,17 @@ static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y,
 
     if (settings->center_x)
         *x = screen->x + screen->width / 2 - client->area.width / 2;
+    else if (settings->opposite_x)
+        *x = screen->x + screen->width - client->frame->area.width -
+            settings->position.x;
     else
         *x = screen->x + settings->position.x;
 
     if (settings->center_y)
         *y = screen->y + screen->height / 2 - client->area.height / 2;
+    else if (settings->opposite_y)
+        *y = screen->y + screen->height - client->frame->area.height -
+            settings->position.y;
     else
         *y = screen->y + settings->position.y;