]> Dogcows Code - chaz/openbox/blobdiff - openbox/place.c
update the user-interaction timestamp when running a (non-interactive) action on...
[chaz/openbox] / openbox / place.c
index cf4d304814f4405c0a662dff65b8cf90df3e12f5..d9919d0cadd3ed09c53e23a820d1642f006fad07 100644 (file)
@@ -107,9 +107,8 @@ static Rect **pick_head(ObClient *c)
     screen_pointer_pos(&px, &py);
 
     for (i = 0; i < screen_num_monitors; i++) {
-        Rect *monitor = screen_physical_area_monitor(i);
+        const Rect *monitor = screen_physical_area_monitor(i);
         gboolean contain = RECT_CONTAINS(*monitor, px, py);
-        g_free(monitor);
         if (contain) {
             add_choice(choice, i);
             ob_debug("placement adding choice %d for mouse pointer", i);
@@ -158,7 +157,7 @@ static gboolean place_random(ObClient *client, gint *x, gint *y)
 
 static GSList* area_add(GSList *list, Rect *a)
 {
-    Rect *r = g_new(Rect, 1);
+    Rect *r = g_slice_new(Rect);
     *r = *a;
     return g_slist_prepend(list, r);
 }
@@ -210,7 +209,7 @@ static GSList* area_remove(GSList *list, Rect *a)
             }
 
             /* 'r' is not being added to the result list, so free it */
-            g_free(r);
+            g_slice_free(Rect, r);
         }
     }
     g_slist_free(list);
@@ -332,7 +331,7 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y)
             }
 
             while (spaces) {
-                g_free(spaces->data);
+                g_slice_free(Rect, spaces->data);
                 spaces = g_slist_delete_link(spaces, spaces);
             }
         }
@@ -407,6 +406,8 @@ static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y,
             settings->position.x.pos;
     else
         *x = screen->x + settings->position.x.pos;
+    if (settings->position.x.denom)
+        *x = (*x * screen->width) / settings->position.x.denom;
 
     if (settings->position.y.center)
         *y = screen->y + screen->height / 2 - client->area.height / 2;
@@ -415,6 +416,8 @@ static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y,
             settings->position.y.pos;
     else
         *y = screen->y + settings->position.y.pos;
+    if (settings->position.y.denom)
+        *y = (*y * screen->height) / settings->position.y.denom;
 
     g_slice_free(Rect, screen);
     return TRUE;
This page took 0.021375 seconds and 4 git commands to generate.