-static void client_toggle_border(ObClient *self, gboolean show)
-{
- /* adjust our idea of where the client is, based on its border. When the
- border is removed, the client should now be considered to be in a
- different position.
- when re-adding the border to the client, the same operation needs to be
- reversed. */
- gint oldx = self->area.x, oldy = self->area.y;
- gint x = oldx, y = oldy;
- switch(self->gravity) {
- default:
- case NorthWestGravity:
- case WestGravity:
- case SouthWestGravity:
- break;
- case NorthEastGravity:
- case EastGravity:
- case SouthEastGravity:
- if (show) x -= self->border_width * 2;
- else x += self->border_width * 2;
- break;
- case NorthGravity:
- case SouthGravity:
- case CenterGravity:
- case ForgetGravity:
- case StaticGravity:
- if (show) x -= self->border_width;
- else x += self->border_width;
- break;
- }
- switch(self->gravity) {
- default:
- case NorthWestGravity:
- case NorthGravity:
- case NorthEastGravity:
- break;
- case SouthWestGravity:
- case SouthGravity:
- case SouthEastGravity:
- if (show) y -= self->border_width * 2;
- else y += self->border_width * 2;
- break;
- case WestGravity:
- case EastGravity:
- case CenterGravity:
- case ForgetGravity:
- case StaticGravity:
- if (show) y -= self->border_width;
- else y += self->border_width;
- break;
- }
- self->area.x = x;
- self->area.y = y;
-
- if (show) {
- XSetWindowBorderWidth(ob_display, self->window, self->border_width);
-
- /* set border_width to 0 because there is no border to add into
- calculations anymore */
- self->border_width = 0;
- } else
- XSetWindowBorderWidth(ob_display, self->window, 0);
-}
-
-