-static guint translate_row_col(guint r, guint c)
-{
- switch (screen_desktop_layout.orientation) {
- case OB_ORIENTATION_HORZ:
- switch (screen_desktop_layout.start_corner) {
- case OB_CORNER_TOPLEFT:
- return r % screen_desktop_layout.rows *
- screen_desktop_layout.columns +
- c % screen_desktop_layout.columns;
- case OB_CORNER_BOTTOMLEFT:
- return (screen_desktop_layout.rows - 1 -
- r % screen_desktop_layout.rows) *
- screen_desktop_layout.columns +
- c % screen_desktop_layout.columns;
- case OB_CORNER_TOPRIGHT:
- return r % screen_desktop_layout.rows *
- screen_desktop_layout.columns +
- (screen_desktop_layout.columns - 1 -
- c % screen_desktop_layout.columns);
- case OB_CORNER_BOTTOMRIGHT:
- 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);
- }
- case OB_ORIENTATION_VERT:
- switch (screen_desktop_layout.start_corner) {
- case OB_CORNER_TOPLEFT:
- return c % screen_desktop_layout.columns *
- screen_desktop_layout.rows +
- r % screen_desktop_layout.rows;
- case OB_CORNER_BOTTOMLEFT:
- return c % screen_desktop_layout.columns *
- screen_desktop_layout.rows +
- (screen_desktop_layout.rows - 1 -
- r % screen_desktop_layout.rows);
- case OB_CORNER_TOPRIGHT:
- return (screen_desktop_layout.columns - 1 -
- c % screen_desktop_layout.columns) *
- screen_desktop_layout.rows +
- r % screen_desktop_layout.rows;
- case OB_CORNER_BOTTOMRIGHT:
- 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);
- }
- }
- g_assert_not_reached();
- return 0;
+void action_send_to_desktop_dir(union ActionData *data)
+{
+ ObClient *c = data->sendtodir.c;
+ guint d;
+
+ if (!c || !client_normal(c)) return;
+
+ d = screen_cycle_desktop(data->sendtodir.dir, data->sendtodir.wrap,
+ data->sendtodir.linear,
+ data->sendtodir.final, data->sendtodir.cancel);
+ client_set_desktop(c, d, TRUE);
+ screen_set_desktop(d);