summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-15 02:20:38 +0000
committerDana Jansens <danakj@orodu.net>2003-09-15 02:20:38 +0000
commite8c1967aa21b69582f8679525543bed49007fc58 (patch)
treec317ab3d1e7dc7b074b008e6d50f8be962bda09d
parent9fe2ce3f850492064a1db438a4d037d0b65c5adb (diff)
always use smart placement, add under-mouse placement for the fallback
-rw-r--r--openbox/place.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/openbox/place.c b/openbox/place.c
index e6342e05..496357ef 100644
--- a/openbox/place.c
+++ b/openbox/place.c
@@ -3,6 +3,7 @@
#include "screen.h"
#include "frame.h"
#include "focus.h"
+#include "config.h"
static Rect* pick_head(ObClient *c)
{
@@ -38,6 +39,7 @@ static Rect* pick_head(ObClient *c)
return NULL;
}
+#if 0
static gboolean place_random(ObClient *client, gint *x, gint *y)
{
int l, r, t, b;
@@ -63,6 +65,7 @@ static gboolean place_random(ObClient *client, gint *x, gint *y)
return TRUE;
}
+#endif
static GSList* area_add(GSList *list, Rect *a)
{
@@ -178,6 +181,18 @@ static gboolean place_smart(ObClient *client, gint *x, gint *y)
return ret;
}
+static gboolean place_under_mouse(ObClient *client, gint *x, gint *y)
+{
+ int px, py;
+
+ screen_pointer_pos(&px, &py);
+
+ *x = px - client->area.width / 2 - client->frame->size.left;
+ *y = py - client->area.height / 2 - client->frame->size.top;
+
+ return TRUE;
+}
+
static gboolean place_transient(ObClient *client, gint *x, gint *y)
{
if (client->transient_for) {
@@ -247,7 +262,7 @@ void place_client(ObClient *client, gint *x, gint *y)
return;
if (place_smart(client, x, y))
return;
- if (place_random(client, x, y))
+ if (place_under_mouse(client, x, y))
return;
g_assert_not_reached(); /* the last one better succeed */
}