maybe fix transients placed offscreen under certain conditions
This commit is contained in:
parent
997a68aaae
commit
c234ed9ecd
3 changed files with 20 additions and 14 deletions
|
@ -415,8 +415,9 @@ void client_manage(Window window)
|
||||||
if (ob_state() == OB_STATE_RUNNING) {
|
if (ob_state() == OB_STATE_RUNNING) {
|
||||||
gint x = self->area.x, ox = x;
|
gint x = self->area.x, ox = x;
|
||||||
gint y = self->area.y, oy = y;
|
gint y = self->area.y, oy = y;
|
||||||
|
gboolean transient;
|
||||||
|
|
||||||
place_client(self, &x, &y, settings);
|
transient = place_client(self, &x, &y, settings);
|
||||||
|
|
||||||
/* make sure the window is visible. */
|
/* make sure the window is visible. */
|
||||||
client_find_onscreen(self, &x, &y,
|
client_find_onscreen(self, &x, &y,
|
||||||
|
@ -432,10 +433,11 @@ void client_manage(Window window)
|
||||||
off-screen and on xinerama divides (ie,
|
off-screen and on xinerama divides (ie,
|
||||||
it is up to the placement routines to avoid
|
it is up to the placement routines to avoid
|
||||||
the xinerama divides) */
|
the xinerama divides) */
|
||||||
((self->positioned & PPosition) &&
|
transient ||
|
||||||
!(self->positioned & USPosition)) &&
|
(((self->positioned & PPosition) &&
|
||||||
client_normal(self) &&
|
!(self->positioned & USPosition)) &&
|
||||||
!self->session);
|
client_normal(self) &&
|
||||||
|
!self->session));
|
||||||
if (x != ox || y != oy)
|
if (x != ox || y != oy)
|
||||||
client_move(self, x, y);
|
client_move(self, x, y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,21 +412,24 @@ static gboolean place_transient(ObClient *client, gint *x, gint *y)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void place_client(ObClient *client, gint *x, gint *y, ObAppSettings *settings)
|
/* Return TRUE if we want client.c to enforce on-screen-keeping */
|
||||||
|
gboolean place_client(ObClient *client, gint *x, gint *y, ObAppSettings *settings)
|
||||||
{
|
{
|
||||||
|
gboolean ret = FALSE;
|
||||||
if (client->positioned)
|
if (client->positioned)
|
||||||
return;
|
return FALSE;
|
||||||
if (place_transient(client, x, y) ||
|
if (place_transient(client, x, y))
|
||||||
|
ret = TRUE;;
|
||||||
|
else if (!(
|
||||||
place_per_app_setting(client, x, y, settings) ||
|
place_per_app_setting(client, x, y, settings) ||
|
||||||
((config_place_policy == OB_PLACE_POLICY_MOUSE) ?
|
((config_place_policy == OB_PLACE_POLICY_MOUSE) ?
|
||||||
place_under_mouse(client, x, y) :
|
place_under_mouse(client, x, y) :
|
||||||
place_smart(client, x, y, SMART_FULL) ||
|
place_smart(client, x, y, SMART_FULL) ||
|
||||||
place_smart(client, x, y, SMART_GROUP) ||
|
place_smart(client, x, y, SMART_GROUP) ||
|
||||||
place_smart(client, x, y, SMART_FOCUSED) ||
|
place_smart(client, x, y, SMART_FOCUSED) ||
|
||||||
place_random(client, x, y)))
|
place_random(client, x, y))))
|
||||||
{
|
|
||||||
/* get where the client should be */
|
|
||||||
frame_frame_gravity(client->frame, x, y);
|
|
||||||
} else
|
|
||||||
g_assert_not_reached(); /* the last one better succeed */
|
g_assert_not_reached(); /* the last one better succeed */
|
||||||
|
/* get where the client should be */
|
||||||
|
frame_frame_gravity(client->frame, x, y);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ typedef enum
|
||||||
OB_PLACE_POLICY_MOUSE
|
OB_PLACE_POLICY_MOUSE
|
||||||
} ObPlacePolicy;
|
} ObPlacePolicy;
|
||||||
|
|
||||||
void place_client(struct _ObClient *client, gint *x, gint *y, struct _ObAppSettings *settings);
|
gboolean place_client(struct _ObClient *client, gint *x, gint *y,
|
||||||
|
struct _ObAppSettings *settings);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue