From dbbbbb7d48a03910554ab933ef71eb0e10f7a8e7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 27 Feb 2008 23:11:08 -0500 Subject: When showing a window's title in the kill prompt, if it doesn't have a title use its parent's (same way the focus cycle popup does) --- openbox/client.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 20a4dffc..39a54820 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3410,7 +3410,14 @@ static void client_prompt_kill(ObClient *self) { 0, OB_KILL_RESULT_YES } }; gchar *m; - const gchar *y; + const gchar *y, *title; + + title = self->original_title; + if (title[0] == '\0') { + /* empty string, so use its parent */ + ObClient *p = client_search_top_direct_parent(self); + if (p) title = p->original_title; + } if (client_on_localhost(self)) { const gchar *sig; @@ -3422,13 +3429,13 @@ static void client_prompt_kill(ObClient *self) m = g_strdup_printf (_("The window \"%s\" does not seem to be responding. Do you want to force it to exit by sending the %s signal?"), - self->original_title, sig); + title, sig); y = _("End Process"); } else { m = g_strdup_printf (_("The window \"%s\" does not seem to be responding. Do you want to disconnect it from the X server?"), - self->original_title); + title); y = _("Disconnect"); } /* set the dialog buttons' text */ -- cgit v1.2.3 From ff0f8dc6a965ed5bcb70430ec4e1ebd68607a614 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 28 Feb 2008 01:20:20 -0500 Subject: fix some off-by-one errors in edge finding for moving and resizing windows (bug 3506) --- openbox/client.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 39a54820..8fb10bb9 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -4107,17 +4107,17 @@ static void detect_edge(Rect area, ObDirection dir, if (my_head <= head + 1) skip_head = TRUE; /* check if our window's tail is past the tail of this window */ - if (my_head + my_size - 1 <= tail) + if (my_head + my_size - 1 < tail) skip_tail = TRUE; /* check if the head of this window is closer than the previously chosen edge (take into account that the previously chosen edge might have been a tail, not a head) */ - if (head + (*near_edge ? 0 : my_size) < *dest) + if (head + (*near_edge ? 0 : my_size) <= *dest) skip_head = TRUE; /* check if the tail of this window is closer than the previously chosen edge (take into account that the previously chosen edge might have been a head, not a tail) */ - if (tail - (!*near_edge ? 0 : my_size) < *dest) + if (tail - (!*near_edge ? 0 : my_size) <= *dest) skip_tail = TRUE; break; case OB_DIRECTION_SOUTH: @@ -4126,17 +4126,17 @@ static void detect_edge(Rect area, ObDirection dir, if (my_head >= head - 1) skip_head = TRUE; /* check if our window's tail is past the tail of this window */ - if (my_head - my_size + 1 >= tail) + if (my_head - my_size + 1 > tail) skip_tail = TRUE; /* check if the head of this window is closer than the previously chosen edge (take into account that the previously chosen edge might have been a tail, not a head) */ - if (head - (*near_edge ? 0 : my_size) > *dest) + if (head - (*near_edge ? 0 : my_size) >= *dest) skip_head = TRUE; /* check if the tail of this window is closer than the previously chosen edge (take into account that the previously chosen edge might have been a head, not a tail) */ - if (tail + (!*near_edge ? 0 : my_size) > *dest) + if (tail + (!*near_edge ? 0 : my_size) >= *dest) skip_tail = TRUE; break; default: @@ -4144,7 +4144,7 @@ static void detect_edge(Rect area, ObDirection dir, } ob_debug("my head %d size %d\n", my_head, my_size); - ob_debug("head %d tail %d deest %d\n", head, tail, *dest); + ob_debug("head %d tail %d dest %d\n", head, tail, *dest); if (!skip_head) { ob_debug("using near edge %d\n", head); *dest = head; -- cgit v1.2.3 From 2f1dc6da006adb7ffac7ec8ddd8c2c8188aed777 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 28 Feb 2008 12:42:40 +0100 Subject: Try to fix the off-by-one errors even more. --- openbox/client.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 8fb10bb9..02008de9 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -4107,7 +4107,7 @@ static void detect_edge(Rect area, ObDirection dir, if (my_head <= head + 1) skip_head = TRUE; /* check if our window's tail is past the tail of this window */ - if (my_head + my_size - 1 < tail) + if (my_head + my_size - 1 <= tail) skip_tail = TRUE; /* check if the head of this window is closer than the previously chosen edge (take into account that the previously chosen @@ -4126,7 +4126,7 @@ static void detect_edge(Rect area, ObDirection dir, if (my_head >= head - 1) skip_head = TRUE; /* check if our window's tail is past the tail of this window */ - if (my_head - my_size + 1 > tail) + if (my_head - my_size + 1 >= tail) skip_tail = TRUE; /* check if the head of this window is closer than the previously chosen edge (take into account that the previously chosen @@ -4307,28 +4307,28 @@ void client_find_resize_directional(ObClient *self, ObDirection side, switch (side) { case OB_DIRECTION_EAST: head = RECT_RIGHT(self->frame->area) + - (self->size_inc.width - 1) * (grow ? 1 : -1); + (self->size_inc.width - 1) * (grow ? 1 : 0); e_start = RECT_TOP(self->frame->area); e_size = self->frame->area.height; dir = grow ? OB_DIRECTION_EAST : OB_DIRECTION_WEST; break; case OB_DIRECTION_WEST: head = RECT_LEFT(self->frame->area) - - (self->size_inc.width - 1) * (grow ? 1 : -1); + (self->size_inc.width - 1) * (grow ? 1 : 0); e_start = RECT_TOP(self->frame->area); e_size = self->frame->area.height; dir = grow ? OB_DIRECTION_WEST : OB_DIRECTION_EAST; break; case OB_DIRECTION_NORTH: head = RECT_TOP(self->frame->area) - - (self->size_inc.height - 1) * (grow ? 1 : -1); + (self->size_inc.height - 1) * (grow ? 1 : 0); e_start = RECT_LEFT(self->frame->area); e_size = self->frame->area.width; dir = grow ? OB_DIRECTION_NORTH : OB_DIRECTION_SOUTH; break; case OB_DIRECTION_SOUTH: head = RECT_BOTTOM(self->frame->area) + - (self->size_inc.height - 1) * (grow ? 1 : -1); + (self->size_inc.height - 1) * (grow ? 1 : 0); e_start = RECT_LEFT(self->frame->area); e_size = self->frame->area.width; dir = grow ? OB_DIRECTION_SOUTH : OB_DIRECTION_NORTH; -- cgit v1.2.3 From a4a1a667fc341b1fb2c420b6b699a9074fefbdad Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 28 Feb 2008 10:00:29 -0500 Subject: If a window is maximized and has FUNC_MAXIMIZE disabled, still let it unmaximize. When normal hints change and we reconfigure, the w/h of the window may not have changed - rather the minw/maxh etc may have changed. So in client_try_configure always run through the code that checks them to see if the client should be resized or whatever. --- openbox/client.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 02008de9..816fa922 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2874,8 +2874,10 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, /* gets the client's position */ frame_frame_gravity(self->frame, x, y); - /* work within the preferred sizes given by the window */ - if (!(*w == self->area.width && *h == self->area.height)) { + /* work within the preferred sizes given by the window, these may have + changed rather than it's requested width and height, so always run + through this code */ + { gint basew, baseh, minw, minh; gint incw, inch; gfloat minratio, maxratio; @@ -3254,7 +3256,7 @@ void client_maximize(ObClient *self, gboolean max, gint dir) gint x, y, w, h; g_assert(dir == 0 || dir == 1 || dir == 2); - if (!(self->functions & OB_CLIENT_FUNC_MAXIMIZE)) return; /* can't */ + if (!(self->functions & OB_CLIENT_FUNC_MAXIMIZE) && max) return;/* can't */ /* check if already done */ if (max) { -- cgit v1.2.3