- case Orientation_Vert:
- switch (screen_desktop_layout.start_corner) {
- case Corner_TopLeft:
- return c * screen_desktop_layout.rows + r;
- case Corner_BottomLeft:
- return c * screen_desktop_layout.rows +
- (screen_desktop_layout.rows - 1 - r);
- case Corner_TopRight:
- return (screen_desktop_layout.columns - 1 - c) *
- screen_desktop_layout.rows + r;
- case Corner_BottomRight:
- return (screen_desktop_layout.columns - 1 - c) *
- screen_desktop_layout.rows +
- (screen_desktop_layout.rows - 1 - r);
+ g_free(actname);
+ }
+ return act;
+}
+
+void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
+ guint state, guint button, gint x, gint y, Time time,
+ gboolean cancel, gboolean done)
+{
+ GSList *it;
+ ObAction *a;
+
+ if (!acts)
+ return;
+
+ if (x < 0 && y < 0)
+ screen_pointer_pos(&x, &y);
+
+ for (it = acts; it; it = g_slist_next(it)) {
+ a = it->data;
+
+ if (!(a->data.any.client_action == OB_CLIENT_ACTION_ALWAYS && !c)) {
+ a->data.any.c = a->data.any.client_action ? c : NULL;
+ a->data.any.context = context;
+ a->data.any.x = x;
+ a->data.any.y = y;
+
+ a->data.any.button = button;
+
+ a->data.any.time = time;
+
+ if (a->data.any.interactive) {
+ a->data.inter.cancel = cancel;
+ a->data.inter.final = done;
+ if (!(cancel || done))
+ if (!keyboard_interactive_grab(state, a->data.any.c, a))
+ continue;
+ }
+
+ /* XXX UGLY HACK race with motion event starting a move and the
+ button release gettnig processed first. answer: don't queue
+ moveresize starts. UGLY HACK XXX
+
+ XXX ALSO don't queue showmenu events, because on button press
+ events we need to know if a mouse grab is going to take place,
+ and set the button to 0, so that later motion events don't think
+ that a drag is going on. since showmenu grabs the pointer..
+ */
+ if (a->data.any.interactive || a->func == action_move ||
+ a->func == action_resize || a->func == action_showmenu)
+ {
+ /* interactive actions are not queued */
+ a->func(&a->data);
+ } else if (a->func == action_focus ||
+ a->func == action_activate ||
+ a->func == action_showmenu)
+ {
+ /* XXX MORE UGLY HACK
+ actions from clicks on client windows are NOT queued.
+ this solves the mysterious click-and-drag-doesnt-work
+ problem. it was because the window gets focused and stuff
+ after the button event has already been passed through. i
+ dont really know why it should care but it does and it makes
+ a difference.
+
+ however this very bogus ! !
+ we want to send the button press to the window BEFORE
+ we do the action because the action might move the windows
+ (eg change desktops) and then the button press ends up on
+ the completely wrong window !
+ so, this is just for that bug, and it will only NOT queue it
+ if it is a focusing action that can be used with the mouse
+ pointer. ugh.
+
+ also with the menus, there is a race going on. if the
+ desktop wants to pop up a menu, and we do too, we send them
+ the button before we pop up the menu, so they pop up their
+ menu first. but not always. if we pop up our menu before
+ sending them the button press, then the result is
+ deterministic. yay.
+
+ XXX further more. focus actions are not queued at all,
+ because if you bind focus->showmenu, the menu will get
+ hidden to do the focusing
+ */
+ a->func(&a->data);
+ } else
+ ob_main_loop_queue_action(ob_main_loop, a);