#include "client.h"
-#include "grab.h"
#include "focus.h"
#include "moveresize.h"
#include "menu.h"
#include "prop.h"
#include "stacking.h"
#include "frame.h"
-#include "framerender.h"
#include "screen.h"
#include "action.h"
#include "dispatch.h"
{
if (data->client.c) {
client_focus(data->client.c);
- stacking_raise(data->client.c);
+ stacking_raise(CLIENT_AS_WINDOW(data->client.c));
}
}
void action_raise(union ActionData *data)
{
if (data->client.c)
- stacking_raise(data->client.c);
+ stacking_raise(CLIENT_AS_WINDOW(data->client.c));
}
void action_unshaderaise(union ActionData *data)
if (data->client.c->shaded)
client_shade(data->client.c, FALSE);
else
- stacking_raise(data->client.c);
+ stacking_raise(CLIENT_AS_WINDOW(data->client.c));
}
}
{
if (data->client.c) {
if (data->client.c->shaded)
- stacking_lower(data->client.c);
+ stacking_lower(CLIENT_AS_WINDOW(data->client.c));
else
client_shade(data->client.c, TRUE);
}
void action_lower(union ActionData *data)
{
if (data->client.c)
- stacking_lower(data->client.c);
+ stacking_lower(CLIENT_AS_WINDOW(data->client.c));
}
void action_close(union ActionData *data)
case Orientation_Horz:
switch (screen_desktop_layout.start_corner) {
case Corner_TopLeft:
- return r * screen_desktop_layout.columns + c;
+ return r % screen_desktop_layout.rows *
+ screen_desktop_layout.columns +
+ c % screen_desktop_layout.columns;
case Corner_BottomLeft:
- return (screen_desktop_layout.rows - 1 - r) *
- screen_desktop_layout.columns + c;
+ return (screen_desktop_layout.rows - 1 -
+ r % screen_desktop_layout.rows) *
+ screen_desktop_layout.columns +
+ c % screen_desktop_layout.columns;
case Corner_TopRight:
- return r * screen_desktop_layout.columns +
- (screen_desktop_layout.columns - 1 - c);
+ return r % screen_desktop_layout.rows *
+ screen_desktop_layout.columns +
+ (screen_desktop_layout.columns - 1 -
+ c % screen_desktop_layout.columns);
case Corner_BottomRight:
- return (screen_desktop_layout.rows - 1 - r) *
+ return (screen_desktop_layout.rows - 1 -
+ r % screen_desktop_layout.rows) *
screen_desktop_layout.columns +
- (screen_desktop_layout.columns - 1 - c);
+ (screen_desktop_layout.columns - 1 -
+ c % screen_desktop_layout.columns);
}
case Orientation_Vert:
switch (screen_desktop_layout.start_corner) {
case Corner_TopLeft:
- return c * screen_desktop_layout.rows + r;
+ return c % screen_desktop_layout.columns *
+ screen_desktop_layout.rows +
+ r % screen_desktop_layout.rows;
case Corner_BottomLeft:
- return c * screen_desktop_layout.rows +
- (screen_desktop_layout.rows - 1 - r);
+ return c % screen_desktop_layout.columns *
+ screen_desktop_layout.rows +
+ (screen_desktop_layout.rows - 1 -
+ r % screen_desktop_layout.rows);
case Corner_TopRight:
- return (screen_desktop_layout.columns - 1 - c) *
- screen_desktop_layout.rows + r;
+ return (screen_desktop_layout.columns - 1 -
+ c % screen_desktop_layout.columns) *
+ screen_desktop_layout.rows +
+ r % screen_desktop_layout.rows;
case Corner_BottomRight:
- return (screen_desktop_layout.columns - 1 - c) *
+ return (screen_desktop_layout.columns - 1 -
+ c % screen_desktop_layout.columns) *
screen_desktop_layout.rows +
- (screen_desktop_layout.rows - 1 - r);
+ (screen_desktop_layout.rows - 1 -
+ r % screen_desktop_layout.rows);
}
}
g_assert_not_reached();
cur_row_col(&r, &c);
++c;
+ if (c >= screen_desktop_layout.columns)
+ c = 0;
d = translate_row_col(r, c);
if (d >= screen_num_desktops) {
if (!data->nextprevdesktop.wrap) return;
- c = 0;
- }
- if (d >= screen_num_desktops)
++c;
+ }
d = translate_row_col(r, c);
if (d < screen_num_desktops)
screen_set_desktop(d);
cur_row_col(&r, &c);
--c;
+ if (c >= screen_desktop_layout.columns)
+ c = screen_desktop_layout.columns - 1;
d = translate_row_col(r, c);
if (d >= screen_num_desktops) {
if (!data->nextprevdesktop.wrap) return;
- c = screen_desktop_layout.columns - 1;
- }
- if (d >= screen_num_desktops)
--c;
+ }
d = translate_row_col(r, c);
if (d < screen_num_desktops)
screen_set_desktop(d);
cur_row_col(&r, &c);
++r;
+ if (r >= screen_desktop_layout.rows)
+ r = 0;
d = translate_row_col(r, c);
if (d >= screen_num_desktops) {
if (!data->nextprevdesktop.wrap) return;
- r = 0;
- }
- if (d >= screen_num_desktops)
++r;
+ }
d = translate_row_col(r, c);
if (d < screen_num_desktops)
screen_set_desktop(d);
cur_row_col(&r, &c);
--r;
+ if (r >= screen_desktop_layout.rows)
+ r = screen_desktop_layout.rows - 1;
d = translate_row_col(r, c);
if (d >= screen_num_desktops) {
if (!data->nextprevdesktop.wrap) return;
- c = screen_desktop_layout.rows - 1;
- }
- if (d >= screen_num_desktops)
--r;
+ }
d = translate_row_col(r, c);
if (d < screen_num_desktops)
screen_set_desktop(d);
}
}
-static void popup_cycle(Client *c, gboolean hide)
-{
- XSetWindowAttributes attrib;
- static Window coords = None;
-
- if (coords == None) {
- attrib.override_redirect = TRUE;
- coords = XCreateWindow(ob_display, ob_root,
- 0, 0, 1, 1, 0, render_depth, InputOutput,
- render_visual, CWOverrideRedirect, &attrib);
- g_assert(coords != None);
-
- grab_pointer(TRUE, None);
-
- XMapWindow(ob_display, coords);
- }
-
- if (hide) {
- XDestroyWindow(ob_display, coords);
- coords = None;
-
- grab_pointer(FALSE, None);
- } else {
- Rect *a;
- Size s;
-
- a = screen_area(c->desktop);
-
- framerender_size_popup_label(c->title, &s);
- XMoveResizeWindow(ob_display, coords,
- a->x + (a->width - s.width) / 2,
- a->y + (a->height - s.height) / 2,
- s.width, s.height);
- framerender_popup_label(coords, &s, c->title);
- }
-}
-
void action_cycle_windows(union ActionData *data)
{
Client *c;
c = focus_cycle(data->cycle.forward, data->cycle.linear, data->cycle.final,
data->cycle.cancel);
- popup_cycle(c, !c || data->cycle.final || data->cycle.cancel);
}