X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=e63f78678018361bd346a493d32cfd9408fc1be7;hb=1b75005e0d86ef8f4a80ad4f1ecda1d7c2c55048;hp=eae55bcc8adbb13afd66f04411a0db39f174144d;hpb=d89391ec941077c556246bfc49b53919e694fd3e;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index eae55bcc..e63f7867 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1,3 +1,21 @@ +/* -*- 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. +*/ + #include "client.h" #include "debug.h" #include "startupnotify.h" @@ -461,6 +479,7 @@ void client_unmanage(ObClient *self) g_free(self->name); g_free(self->class); g_free(self->role); + g_free(self->sm_client_id); g_free(self); /* update the list hints */ @@ -551,14 +570,16 @@ gboolean client_find_onscreen(ObClient *self, int *x, int *y, int w, int h, /* XXX watch for xinerama dead areas */ a = screen_area(self->desktop); - if (!self->strut.right && *x >= a->x + a->width - 1) - *x = a->x + a->width - self->frame->area.width; - if (!self->strut.bottom && *y >= a->y + a->height - 1) - *y = a->y + a->height - self->frame->area.height; - if (!self->strut.left && *x + self->frame->area.width - 1 < a->x) - *x = a->x; - if (!self->strut.top && *y + self->frame->area.height - 1 < a->y) - *y = a->y; + if (client_normal(self)) { + if (!self->strut.right && *x >= a->x + a->width - 1) + *x = a->x + a->width - self->frame->area.width; + if (!self->strut.bottom && *y >= a->y + a->height - 1) + *y = a->y + a->height - self->frame->area.height; + if (!self->strut.left && *x + self->frame->area.width - 1 < a->x) + *x = a->x; + if (!self->strut.top && *y + self->frame->area.height - 1 < a->y) + *y = a->y; + } if (rude) { /* this is my MOZILLA BITCHSLAP. oh ya it fucking feels good. @@ -675,6 +696,7 @@ static void client_get_all(ObClient *self) client_update_title(self); client_update_class(self); + client_update_sm_client_id(self); client_update_strut(self); client_update_icons(self); } @@ -1938,8 +1960,8 @@ void client_configure_full(ObClient *self, ObCorner anchor, (resized && config_redraw_resize)))); /* if the client is enlarging, the resize the client before the frame */ - if (send_resize_client && (w > oldw || h > oldh)) - XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh)); + if (send_resize_client && user && (w > oldw || h > oldh)) + XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh)); /* move/resize the frame to match the request */ if (self->frame) { @@ -1969,12 +1991,12 @@ void client_configure_full(ObClient *self, ObCorner anchor, event.xconfigure.override_redirect = FALSE; XSendEvent(event.xconfigure.display, event.xconfigure.window, FALSE, StructureNotifyMask, &event); - } + } } /* if the client is shrinking, then resize the frame before the client */ - if (send_resize_client && (w <= oldw || h <= oldh)) - XResizeWindow(ob_display, self->window, w, h); + if (send_resize_client && (!user || (w <= oldw || h <= oldh))) + XResizeWindow(ob_display, self->window, w, h); XFlush(ob_display); } @@ -2793,13 +2815,15 @@ ObClient *client_search_transient(ObClient *self, ObClient *search) return NULL; } -gchar* client_get_sm_client_id(ObClient *self) +void client_update_sm_client_id(ObClient *self) { - gchar *id = NULL; + g_free(self->sm_client_id); + self->sm_client_id = NULL; - if (!PROP_GETS(self->window, sm_client_id, locale, &id) && self->group) - PROP_GETS(self->group->leader, sm_client_id, locale, &id); - return id; + if (!PROP_GETS(self->window, sm_client_id, locale, &self->sm_client_id) && + self->group) + PROP_GETS(self->group->leader, sm_client_id, locale, + &self->sm_client_id); } /* finds the nearest edge in the given direction from the current client