X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=4ac234d73315a9d3137078f70c0643e3a99f4249;hb=3541c60fcbee11fe4fe7ba806219c3c16bb5a574;hp=c5934dedbe6159d6d053247dd10e246cd30582ea;hpb=e9d878f47dfd70e495754459dbef24c37ea96de1;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index c5934ded..4ac234d7 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -660,8 +660,6 @@ static void client_get_all(ObClient *self) client_get_state(self); client_get_shaped(self); - g_message("self->iconic %d", self->iconic); - client_get_mwm_hints(self); client_get_type(self);/* this can change the mwmhints for special cases */ @@ -1308,10 +1306,11 @@ void client_update_title(ObClient *self) GList *it; guint32 nums; guint i; - char *data = NULL; + gchar *data = NULL; gboolean read_title; + gchar *old_title; - g_free(self->title); + old_title = self->title; /* try netwm */ if (!PROP_GETS(self->window, net_wm_name, utf8, &data)) @@ -1319,6 +1318,10 @@ void client_update_title(ObClient *self) if (!PROP_GETS(self->window, wm_name, locale, &data)) data = g_strdup("Unnamed Window"); + /* did the title change? then reset the title_count */ + if (old_title && 0 != strncmp(old_title, data, strlen(data))) + self->title_count = 1; + /* look for duplicates and append a number */ nums = 0; for (it = client_list; it; it = it->next) @@ -1349,6 +1352,8 @@ void client_update_title(ObClient *self) if (self->frame) frame_adjust_title(self->frame); + g_free(old_title); + /* update the icon title */ data = NULL; g_free(self->icon_title); @@ -1708,7 +1713,6 @@ static void client_apply_startup_state(ObClient *self) { /* these are in a carefully crafted order.. */ - g_message("self->iconic %d", self->iconic); if (self->iconic) { self->iconic = FALSE; client_iconify(self, TRUE, FALSE); @@ -1749,6 +1753,8 @@ void client_configure_full(ObClient *self, ObCorner anchor, gboolean user, gboolean final, gboolean force_reply) { + gint oldw, oldh; + gboolean send_resize_client; gboolean moved = FALSE, resized = FALSE; guint fdecor = self->frame->decorations; gboolean fhorz = self->frame->max_horz; @@ -1910,14 +1916,20 @@ void client_configure_full(ObClient *self, ObCorner anchor, moved = x != self->area.x || y != self->area.y; resized = w != self->area.width || h != self->area.height; + oldw = self->area.width; + oldh = self->area.height; RECT_SET(self->area, x, y, w, h); /* for app-requested resizes, always resize if 'resized' is true. for user-requested ones, only resize if final is true, or when resizing in redraw mode */ - if ((!user && resized) || - (user && (final || (resized && config_redraw_resize)))) - XResizeWindow(ob_display, self->window, w, h); + send_resize_client = ((!user && resized) || + (user && (final || + (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)); /* move/resize the frame to match the request */ if (self->frame) { @@ -1949,6 +1961,12 @@ void client_configure_full(ObClient *self, ObCorner anchor, 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); + + XFlush(ob_display); } void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea)