diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c index df8b551..64a11c9 100644 --- a/gtk/window-decorator/gtk-window-decorator.c +++ b/gtk/window-decorator/gtk-window-decorator.c @@ -4041,18 +4041,30 @@ max_button_event (WnckWindow *win, switch (xevent->type) { case ButtonPress: - if (xevent->xbutton.button == 1) + if (xevent->xbutton.button >= 1 && xevent->xbutton.button <=3) d->button_states[1] |= PRESSED_EVENT_WINDOW; break; case ButtonRelease: - if (xevent->xbutton.button == 1) + if (xevent->xbutton.button >= 1 && xevent->xbutton.button <=3) { if (d->button_states[1] == (PRESSED_EVENT_WINDOW | IN_EVENT_WINDOW)) { - if (wnck_window_is_maximized (win)) - wnck_window_unmaximize (win); - else - wnck_window_maximize (win); + if (xevent->xbutton.button == 1) { + if (wnck_window_is_maximized (win)) + wnck_window_unmaximize (win); + else + wnck_window_maximize (win); + } else if (xevent->xbutton.button == 2) { + if (wnck_window_is_maximized_vertically (win)) + wnck_window_unmaximize_vertically (win); + else + wnck_window_maximize_vertically (win); + } else if (xevent->xbutton.button == 3) { + if (wnck_window_is_maximized_horizontally (win)) + wnck_window_unmaximize_horizontally (win); + else + wnck_window_maximize_horizontally (win); + } } d->button_states[1] &= ~PRESSED_EVENT_WINDOW;