- if (activate) client_focus(self);
+ if (activate) {
+ /* if using focus_delay, stop the timer now so that focus doesn't go
+ moving on us */
+ event_halt_focus_delay();
+
+ client_focus(self);
+ /* since focus can change the stacking orders, if we focus the window
+ then the standard raise it gets is not enough, we need to queue one
+ for after the focus change takes place */
+ client_raise(self);
+ }
RECT_SET(self->area, self->session->x, self->session->y,
self->session->w, self->session->h);
self->positioned = TRUE;
RECT_SET(self->area, self->session->x, self->session->y,
self->session->w, self->session->h);
self->positioned = TRUE;
- XResizeWindow(ob_display, self->window,
- self->session->w, self->session->h);
+ if (self->session->w > 0 && self->session->h > 0)
+ XResizeWindow(ob_display, self->window,
+ self->session->w, self->session->h);
- /* use the first value that we know about in the array */
- for (i = 0; i < num; ++i) {
- if (val[i] == prop_atoms.net_wm_window_type_desktop)
- self->type = OB_CLIENT_TYPE_DESKTOP;
- else if (val[i] == prop_atoms.net_wm_window_type_dock)
- self->type = OB_CLIENT_TYPE_DOCK;
- else if (val[i] == prop_atoms.net_wm_window_type_toolbar)
- self->type = OB_CLIENT_TYPE_TOOLBAR;
- else if (val[i] == prop_atoms.net_wm_window_type_menu)
- self->type = OB_CLIENT_TYPE_MENU;
- else if (val[i] == prop_atoms.net_wm_window_type_utility)
- self->type = OB_CLIENT_TYPE_UTILITY;
- else if (val[i] == prop_atoms.net_wm_window_type_splash)
- self->type = OB_CLIENT_TYPE_SPLASH;
- else if (val[i] == prop_atoms.net_wm_window_type_dialog)
- self->type = OB_CLIENT_TYPE_DIALOG;
- else if (val[i] == prop_atoms.net_wm_window_type_normal)
- self->type = OB_CLIENT_TYPE_NORMAL;
- else if (val[i] == prop_atoms.kde_net_wm_window_type_override) {
- /* prevent this window from getting any decor or
- functionality */
- self->mwmhints.flags &= (OB_MWM_FLAG_FUNCTIONS |
- OB_MWM_FLAG_DECORATIONS);
- self->mwmhints.decorations = 0;
- self->mwmhints.functions = 0;
- }
- if (self->type != (ObClientType) -1)
- break; /* grab the first legit type */
- }
- g_free(val);
+ /* use the first value that we know about in the array */
+ for (i = 0; i < num; ++i) {
+ if (val[i] == prop_atoms.net_wm_window_type_desktop)
+ self->type = OB_CLIENT_TYPE_DESKTOP;
+ else if (val[i] == prop_atoms.net_wm_window_type_dock)
+ self->type = OB_CLIENT_TYPE_DOCK;
+ else if (val[i] == prop_atoms.net_wm_window_type_toolbar)
+ self->type = OB_CLIENT_TYPE_TOOLBAR;
+ else if (val[i] == prop_atoms.net_wm_window_type_menu)
+ self->type = OB_CLIENT_TYPE_MENU;
+ else if (val[i] == prop_atoms.net_wm_window_type_utility)
+ self->type = OB_CLIENT_TYPE_UTILITY;
+ else if (val[i] == prop_atoms.net_wm_window_type_splash)
+ self->type = OB_CLIENT_TYPE_SPLASH;
+ else if (val[i] == prop_atoms.net_wm_window_type_dialog)
+ self->type = OB_CLIENT_TYPE_DIALOG;
+ else if (val[i] == prop_atoms.net_wm_window_type_normal)
+ self->type = OB_CLIENT_TYPE_NORMAL;
+ else if (val[i] == prop_atoms.kde_net_wm_window_type_override) {
+ /* prevent this window from getting any decor or
+ functionality */
+ self->mwmhints.flags &= (OB_MWM_FLAG_FUNCTIONS |
+ OB_MWM_FLAG_DECORATIONS);
+ self->mwmhints.decorations = 0;
+ self->mwmhints.functions = 0;
+ }
+ if (self->type != (ObClientType) -1)
+ break; /* grab the first legit type */
+ }
+ g_free(val);
- /* normal windows retain all of the possible decorations and
- functionality, and are the only windows that you can fullscreen */
- self->functions |= OB_CLIENT_FUNC_FULLSCREEN;
- break;
+ /* normal windows retain all of the possible decorations and
+ functionality, and are the only windows that you can fullscreen */
+ self->functions |= OB_CLIENT_FUNC_FULLSCREEN;
+ break;
- if (! (self->mwmhints.functions & OB_MWM_FUNC_ALL)) {
- if (! (self->mwmhints.functions & OB_MWM_FUNC_RESIZE))
- self->functions &= ~OB_CLIENT_FUNC_RESIZE;
- if (! (self->mwmhints.functions & OB_MWM_FUNC_MOVE))
- self->functions &= ~OB_CLIENT_FUNC_MOVE;
+ if (! (self->mwmhints.functions & OB_MWM_FUNC_ALL)) {
+ if (! (self->mwmhints.functions & OB_MWM_FUNC_RESIZE))
+ self->functions &= ~OB_CLIENT_FUNC_RESIZE;
+ if (! (self->mwmhints.functions & OB_MWM_FUNC_MOVE))
+ self->functions &= ~OB_CLIENT_FUNC_MOVE;
- if (! (self->mwmhints.functions & OB_MWM_FUNC_ICONIFY))
- self->functions &= ~OB_CLIENT_FUNC_ICONIFY;
- if (! (self->mwmhints.functions & OB_MWM_FUNC_MAXIMIZE))
- self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
+ if (! (self->mwmhints.functions & OB_MWM_FUNC_ICONIFY))
+ self->functions &= ~OB_CLIENT_FUNC_ICONIFY;
+ if (! (self->mwmhints.functions & OB_MWM_FUNC_MAXIMIZE))
+ self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
- if (savearea)
- self->pre_max_area = self->area;
+ if (savearea) {
+ if ((dir == 0 || dir == 1) && !self->max_horz) { /* horz */
+ RECT_SET(self->pre_max_area,
+ self->area.x, self->pre_max_area.y,
+ self->area.width, self->pre_max_area.height);
+ }
+ if ((dir == 0 || dir == 2) && !self->max_vert) { /* vert */
+ RECT_SET(self->pre_max_area,
+ self->pre_max_area.x, self->area.y,
+ self->pre_max_area.width, self->area.height);
+ }
+ }