ObAppSettings *settings;
gboolean transient = FALSE;
Rect place;
- Time launch_time, map_time;
+ Time launch_time;
guint32 user_time;
gboolean obplaced;
ob_debug("Managing window: 0x%lx", window);
- map_time = event_get_server_time();
-
/* choose the events we want to receive on the CLIENT window
(ObPrompt windows can request events too) */
attrib_set.event_mask = CLIENT_EVENTMASK |
launch_time = sn_app_started(self->startup_id, self->class, self->name);
if (!OBT_PROP_GET32(self->window, NET_WM_USER_TIME, CARDINAL, &user_time))
- user_time = map_time;
+ user_time = event_time();
/* do this after we have a frame.. it uses the frame to help determine the
WM_STATE to apply. */
/* this checks for focus=false for the window */
(!settings || settings->focus != 0) &&
focus_valid_target(self, self->desktop,
- FALSE, FALSE, TRUE, FALSE, FALSE,
+ FALSE, FALSE, TRUE, TRUE, FALSE, FALSE,
settings->focus == 1))
{
activate = TRUE;
ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s",
activate ? "yes" : "no");
if (activate) {
- activate = client_can_steal_focus(self, map_time, launch_time);
+ activate = client_can_steal_focus(self, event_time(), launch_time);
if (!activate) {
/* if the client isn't stealing focus, then hilite it so the user
if (!(self->desktop == screen_desktop ||
self->desktop == DESKTOP_ALL) &&
/* the timestamp is from before you changed desktops */
- launch_time && screen_desktop_user_time &&
- !event_time_after(launch_time, screen_desktop_user_time))
+ (!launch_time ||
+ (screen_desktop_user_time &&
+ !event_time_after(launch_time, screen_desktop_user_time))))
{
steal = FALSE;
ob_debug_type(OB_DEBUG_FOCUS,
if (!got &&
OBT_PROP_GETA32(self->window, NET_WM_STRUT, CARDINAL, &data, &num)) {
if (num == 4) {
- Rect const *a;
+ const Rect *a;
got = TRUE;
return self->parents != NULL;
}
-gboolean client_is_oldfullscreen(const ObClient const *self,
- const Rect const *area)
+gboolean client_is_oldfullscreen(const ObClient *self,
+ const Rect *area)
{
- Rect const *monitor, *allmonitors;
+ const Rect *monitor, *allmonitors;
/* No decorations and fills the monitor = oldskool fullscreen.
But not for maximized windows.
static ObStackingLayer calc_layer(ObClient *self)
{
ObStackingLayer l;
- Rect const *monitor, *allmonitors;
+ const Rect *monitor, *allmonitors;
monitor = screen_physical_area_monitor(client_monitor(self));
allmonitors = screen_physical_area_all_monitors();
/* set the size and position if fullscreen */
if (self->fullscreen) {
- Rect const *a;
+ const Rect *a;
guint i;
i = screen_find_monitor(&desired);
/* if it moved between monitors, then this can affect the stacking
layer of this window or others - for fullscreen windows.
also if it changed to/from oldschool fullscreen then its layer may
- change */
- if (screen_find_monitor(&self->frame->area) !=
- screen_find_monitor(&oldframe) ||
- (final && (client_is_oldfullscreen(self, &oldclient) !=
- client_is_oldfullscreen(self, &self->area))))
+ change
+
+ watch out tho, don't try change stacking stuff if the window is no
+ longer being managed !
+ */
+ if (self->managed &&
+ (screen_find_monitor(&self->frame->area) !=
+ screen_find_monitor(&oldframe) ||
+ (final && (client_is_oldfullscreen(self, &oldclient) !=
+ client_is_oldfullscreen(self, &self->area)))))
{
client_calc_layer(self);
}
else {
/* request the client to close with WM_DELETE_WINDOW */
OBT_PROP_MSG_TO(self->window, self->window, WM_PROTOCOLS,
- OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime,
+ OBT_PROP_ATOM(WM_DELETE_WINDOW), event_time(),
0, 0, 0, NoEventMask);
/* we're trying to close the window, so see if it is responding. if it
ob_debug_type(OB_DEBUG_FOCUS,
"Focusing client \"%s\" (0x%x) at time %u",
- self->title, self->window, event_curtime);
+ self->title, self->window, event_time());
/* if using focus_delay, stop the timer now so that focus doesn't
go moving on us */
/* This can cause a BadMatch error with CurrentTime, or if an app
passed in a bad time for _NET_WM_ACTIVE_WINDOW. */
XSetInputFocus(obt_display, self->window, RevertToPointerRoot,
- event_curtime);
+ event_time());
}
if (self->focus_notify) {
ce.xclient.window = self->window;
ce.xclient.format = 32;
ce.xclient.data.l[0] = OBT_PROP_ATOM(WM_TAKE_FOCUS);
- ce.xclient.data.l[1] = event_curtime;
+ ce.xclient.data.l[1] = event_time();
ce.xclient.data.l[2] = 0l;
ce.xclient.data.l[3] = 0l;
ce.xclient.data.l[4] = 0l;
if ((user && (desktop ||
self->desktop == DESKTOP_ALL ||
self->desktop == screen_desktop)) ||
- client_can_steal_focus(self, event_curtime, CurrentTime))
+ client_can_steal_focus(self, event_time(), CurrentTime))
{
client_present(self, here, raise, unshade);
}