/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-
-client.c for the Openbox window manager
-Copyright (c) 2003 Ben Jansens
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-See the COPYING file for a copy of the GNU General Public License.
+
+ client.c for the Openbox window manager
+ Copyright (c) 2004 Mikael Magnusson
+ Copyright (c) 2003 Ben Jansens
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
*/
#include "client.h"
/*! The event mask to grab on client windows */
#define CLIENT_EVENTMASK (PropertyChangeMask | FocusChangeMask | \
- StructureNotifyMask)
+ StructureNotifyMask)
#define CLIENT_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \
- ButtonMotionMask)
+ ButtonMotionMask)
typedef struct
{
}
/*
- void client_foreach_transient(ObClient *self, ObClientForeachFunc func, void *data)
+ void client_foreach_transient(ObClient *self, ObClientForeachFunc func, gpointer data)
{
GSList *it;
}
}
- void client_foreach_ancestor(ObClient *self, ObClientForeachFunc func, void *data)
+ void client_foreach_ancestor(ObClient *self, ObClientForeachFunc func, gpointer data)
{
if (self->transient_for) {
if (self->transient_for != OB_TRAN_GROUP) {
keyboard_grab_for_client(self, FALSE);
mouse_grab_for_client(self, FALSE);
+ /* potentially fix focusLast */
+ if (config_focus_last)
+ grab_pointer(TRUE, OB_CURSOR_NONE);
+
/* remove the window from our save set */
XChangeSaveSet(ob_display, self->window, SetModeDelete);
/* update the list hints */
client_set_list();
+
+ if (config_focus_last)
+ grab_pointer(FALSE, OB_CURSOR_NONE);
}
static void client_urgent_notify(ObClient *self)
client_get_mwm_hints(self);
client_get_type(self);/* this can change the mwmhints for special cases */
+ /* The transient hint is used to pick a type, but the type can also affect
+ transiency (dialogs are always made transients). This is Havoc's idea,
+ but it is needed to make some apps work right (eg tsclient). */
+ client_update_transient_for(self);
+
client_get_state(self);
{
}
}
}
+ } else if (self->type == OB_CLIENT_TYPE_DIALOG && self->group) {
+ self->transient = TRUE;
+ target = OB_TRAN_GROUP;
} else
self->transient = FALSE;
/* dont let mwm hints kill the close button
if (! (self->mwmhints.functions & MwmFunc_Close))
self->functions &= ~OB_CLIENT_FUNC_CLOSE; */
- }
+ }
}
if (!(self->functions & OB_CLIENT_FUNC_SHADE))
/* finally, the user can have requested no decorations, which overrides
everything (but doesnt give it a border if it doesnt have one) */
- if (self->undecorated)
- self->decorations &= OB_FRAME_DECOR_BORDER;
+ if (self->undecorated) {
+ if (config_theme_keepborder)
+ self->decorations &= OB_FRAME_DECOR_BORDER;
+ else
+ self->decorations = 0;
+ }
/* if we don't have a titlebar, then we cannot shade! */
if (!(self->decorations & OB_FRAME_DECOR_TITLEBAR))
if (!PROP_GETS(self->window, net_wm_name, utf8, &data))
/* try old x stuff */
if (!PROP_GETS(self->window, wm_name, locale, &data))
- data = g_strdup("Unnamed Window");
+ // http://developer.gnome.org/projects/gup/hig/draft_hig_new/windows-alert.html
+ if (self->transient)
+ data = g_strdup("");
+ else
+ data = g_strdup("Unnamed Window");
/* did the title change? then reset the title_count */
if (old_title && 0 != strncmp(old_title, data, strlen(data)))
w -= self->base_size.width;
h -= self->base_size.height;
- if (self->min_ratio)
- if (h * self->min_ratio > w) {
- h = (gint)(w / self->min_ratio);
+ if (!self->fullscreen) {
+ if (self->min_ratio)
+ if (h * self->min_ratio > w) {
+ h = (gint)(w / self->min_ratio);
- /* you cannot resize to nothing */
- if (h < 1) {
- h = 1;
- w = (gint)(h * self->min_ratio);
+ /* you cannot resize to nothing */
+ if (h < 1) {
+ h = 1;
+ w = (gint)(h * self->min_ratio);
+ }
}
- }
- if (self->max_ratio)
- if (h * self->max_ratio < w) {
- h = (gint)(w / self->max_ratio);
-
- /* you cannot resize to nothing */
- if (h < 1) {
- h = 1;
- w = (gint)(h * self->min_ratio);
+ if (self->max_ratio)
+ if (h * self->max_ratio < w) {
+ h = (gint)(w / self->max_ratio);
+
+ /* you cannot resize to nothing */
+ if (h < 1) {
+ h = 1;
+ w = (gint)(h * self->min_ratio);
+ }
}
- }
+ }
w += self->base_size.width;
h += self->base_size.height;
resizing in redraw mode */
send_resize_client = ((!user && resized) ||
(user && (final ||
- (resized && config_redraw_resize))));
+ (resized && config_resize_redraw))));
- /* if the client is enlarging, the resize the client before the frame */
+ /* if the client is enlarging, then resize the client before the frame */
if (send_resize_client && user && (w > oldw || h > oldh))
XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));