X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=816fa922122950c675304a0cb812ae17cdae72ac;hb=a4a1a667fc341b1fb2c420b6b699a9074fefbdad;hp=3a46f823a6d7853421216547f8eff8294d6210e5;hpb=c38a756ae50616b1431e3137141189a5588654a0;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 3a46f823..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) { @@ -3406,10 +3408,18 @@ static void client_prompt_kill(ObClient *self) /* check if we're already prompting */ if (!self->kill_prompt) { ObPromptAnswer answers[] = { - { _("Cancel"), OB_KILL_RESULT_NO }, - { _("Force Exit"), OB_KILL_RESULT_YES } + { 0, OB_KILL_RESULT_NO }, + { 0, OB_KILL_RESULT_YES } }; gchar *m; + 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; @@ -3420,12 +3430,19 @@ static void client_prompt_kill(ObClient *self) sig = "kill"; 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); + (_("The window \"%s\" does not seem to be responding. Do you want to force it to exit by sending the %s signal?"), + title, sig); + y = _("End Process"); } - else + 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); - + (_("The window \"%s\" does not seem to be responding. Do you want to disconnect it from the X server?"), + title); + y = _("Disconnect"); + } + /* set the dialog buttons' text */ + answers[0].text = _("Cancel"); /* "no" */ + answers[1].text = y; /* "yes" */ self->kill_prompt = prompt_new(m, answers, sizeof(answers)/sizeof(answers[0]), @@ -4097,12 +4114,12 @@ static void detect_edge(Rect area, ObDirection dir, /* 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: @@ -4116,12 +4133,12 @@ static void detect_edge(Rect area, ObDirection dir, /* 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: @@ -4129,7 +4146,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; @@ -4292,28 +4309,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;