diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-03-01 15:55:27 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-03-01 16:32:23 -0500 |
| commit | 28df6162a9fbca4544e8f384d3fdae70870f531a (patch) | |
| tree | 987a2162754a394b98e94dfe41bca3bb9e793b47 /openbox/event.c | |
| parent | cfce98840ac138675971f8421032da9e0030ecc7 (diff) | |
when an app tries to move to 0,0 and there is a strut there (java swing!), move it to inside the strut instead (unless it is an oldschool fullscreen app)
Diffstat (limited to 'openbox/event.c')
| -rw-r--r-- | openbox/event.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/openbox/event.c b/openbox/event.c index 14aa696b..7596fe3e 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1247,6 +1247,49 @@ static void event_handle_client(ObClient *client, XEvent *e) notify is sent or not */ } + /* check for broken apps (java swing) moving to 0,0 when there is a + strut there. + + XXX remove this some day...that would be nice. but really unexpected + from Sun Microsystems. + */ + g_print("x %d y %d grav %d %d\n", x, y, client->gravity, NorthWestGravity); + if (x == 0 && y == 0 && client->gravity == NorthWestGravity) { + const Rect to = { x, y, w, h }; + Rect const *monitor, *allmonitors; + monitor = screen_physical_area_monitor(client_monitor(client)); + allmonitors = screen_physical_area_all_monitors(); + + /* oldschool fullscreen windows are allowed */ + if (!(client->decorations == 0 && + (RECT_EQUAL(to, *monitor) || + RECT_EQUAL(to, *allmonitors)))) + { + Rect *r; + + r = screen_area(client->desktop, SCREEN_AREA_ALL_MONITORS, + NULL); + if (r->x || r->y) { + /* move the window only to the corner outside struts */ + x = r->x; + y = r->y; + + ob_debug_type(OB_DEBUG_APP_BUGS, + "Application %s is trying to move via " + "ConfigureRequest to 0,0 using " + "NorthWestGravity, while there is a " + "strut there. " + "Moving buggy app from (0,0) to (%d,%d)", + client->title, r->x, r->y); + } + + g_slice_free(Rect, r); + + /* they still requested a move, so don't change whether a + notify is sent or not */ + } + } + { gint lw, lh; |
