void handle_mouse_wheel_title_event (WnckWindow *win, unsigned int button) { gint wheel_action = WHEEL_ACTION_NONE; g_object_get (settings, "mouse-wheel-action", &wheel_action, NULL); switch (wheel_action) { case WHEEL_ACTION_SHADE: if (button == 4) { if (!wnck_window_is_shaded (win)) wnck_window_shade (win); } else if (button == 5) { if (wnck_window_is_shaded (win)) wnck_window_unshade (win); } break; default: break; } }
void handle_title_button_event (WnckWindow *win, int action, decor_event *gtkwd_event) { switch (action) { case CLICK_ACTION_SHADE: if (wnck_window_is_shaded (win)) wnck_window_unshade (win); else wnck_window_shade (win); break; case CLICK_ACTION_MAXIMIZE: if (wnck_window_is_maximized (win)) wnck_window_unmaximize (win); else wnck_window_maximize (win); break; case CLICK_ACTION_MINIMIZE: if (!wnck_window_is_minimized (win)) wnck_window_minimize (win); break; case CLICK_ACTION_RAISE: restack_window (win, Above); break; case CLICK_ACTION_LOWER: restack_window (win, Below); break; case CLICK_ACTION_MENU: action_menu_map (win, gtkwd_event->button, gtkwd_event->time); break; } }
/** * "Shades" the window */ int c_shade_window(lua_State *lua) { int top = lua_gettop(lua); if (top != 0) { luaL_error(lua,"shade_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_shade(window); } } return 0; }
void shade_button_event (WnckWindow *win, decor_event *gtkwd_event, decor_event_type gtkwd_type) { decor_t *d = g_object_get_data (G_OBJECT (win), "decor"); guint state = d->button_states[BUTTON_SHADE]; common_button_event (win, gtkwd_event, gtkwd_type, BUTTON_SHADE, 1, _("Shade")); switch (gtkwd_type) { case GButtonRelease: if (gtkwd_event->button == 1) { if (state == BUTTON_EVENT_ACTION_STATE) wnck_window_shade (win); } break; default: break; } }