예제 #1
0
void
max_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_MAX];

    if (action_menu_mapped && gtkwd_type == GButtonPress)
    {
	gtk_object_destroy (GTK_OBJECT (action_menu));
    }

    if (wnck_window_is_maximized (win))
	common_button_event (win, gtkwd_event, gtkwd_type, BUTTON_MAX,
			     3, _("Unmaximize Window"));
    else
	common_button_event (win, gtkwd_event, gtkwd_type, BUTTON_MAX,
			     3, _("Maximize Window"));

    switch (gtkwd_type) {
    case GButtonRelease:
	if (gtkwd_event->button <= 3)
	{
	    if (state == BUTTON_EVENT_ACTION_STATE)
	    {
		if (gtkwd_event->button == 1)
		{
		    if (wnck_window_is_maximized (win))
			wnck_window_unmaximize (win);
		    else if (wnck_window_is_maximized_vertically (win))
			wnck_window_unmaximize_vertically (win);
		    else if (wnck_window_is_maximized_horizontally (win))
			wnck_window_unmaximize_horizontally (win);
		    else
			wnck_window_maximize (win);
		}
		else if (gtkwd_event->button == 2)
		{
		    if (wnck_window_is_maximized_vertically (win))
			wnck_window_unmaximize_vertically (win);
		    else
			wnck_window_maximize_vertically (win);
		}
		else if (gtkwd_event->button == 3)
		{
		    if (wnck_window_is_maximized_horizontally (win))
			wnck_window_unmaximize_horizontally (win);
		    else
			wnck_window_maximize_horizontally (win);
		}
	    }
	}
	break;
    default:
	break;
    }
}
예제 #2
0
void
min_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_MIN];

    if (action_menu_mapped && gtkwd_type == GButtonPress)
    {
	gtk_object_destroy (GTK_OBJECT (action_menu));
    }

    common_button_event (win, gtkwd_event, gtkwd_type,
			 BUTTON_MIN, 1, _("Minimize Window"));

    switch (gtkwd_type) {
    case GButtonRelease:
	if (gtkwd_event->button == 1)
	    if (state == BUTTON_EVENT_ACTION_STATE)
		wnck_window_minimize (win);
	break;
    default:
	break;
    }
}
예제 #3
0
void
menu_button_event (WnckWindow *win,
		   decor_event *gtkwd_event,
		   decor_event_type gtkwd_type)
{

    common_button_event (win, gtkwd_event, gtkwd_type,
			 BUTTON_MENU, 1, _("Window Menu"));

    switch (gtkwd_type) {
    case GButtonPress:
	if (gtkwd_event->button == 1)
	    action_menu_map (win,
			     gtkwd_event->button,
			     gtkwd_event->time);
	break;
    default:
	break;
    }
}
예제 #4
0
void
unstick_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_UNSTICK];

    common_button_event (win, gtkwd_event, gtkwd_type,
			 BUTTON_UNSTICK, 1, _("Unstick"));

    switch (gtkwd_type) {
    case GButtonRelease:
	if (gtkwd_event->button == 1)
	    if (state == BUTTON_EVENT_ACTION_STATE)
		wnck_window_unstick (win);
	break;
    default:
	break;
    }
}
예제 #5
0
파일: events.c 프로젝트: micove/compiz
void
above_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_ABOVE];

    common_button_event (win, gtkwd_event, gtkwd_type,
			 BUTTON_ABOVE, 1, _("Make Above"));

    switch (gtkwd_type) {
    case GButtonRelease:
	if (gtkwd_event->button == 1)
	    if (state == BUTTON_EVENT_ACTION_STATE)
		wnck_window_make_above (win);
	break;
    default:
	break;
    }
}