~canonical-dx-team/unity/unity.maximized_snapoff

« back to all changes in this revision

Viewing changes to src/PanelMenuView.h

  • Committer: Sam Spilsbury
  • Date: 2010-12-27 15:36:20 UTC
  • Revision ID: sam.spilsbury@canonical.com-20101227153620-f3kkirm5id0zqdy7
Added snap-off functionality for maximized windows. Works like the regular
snap-off functionality from compiz and metacity for maximized windows - just
grab the "unused" area of the panel + titlebar while the window is maximized
and drag down - the window will be unmaximized.

changed:
 * src/PanelMenuView.cpp : Add signals
 * src/PanelMenuView.h : Add signal callback methods and _is_grabbed
 * src/WindowManager.cpp : Added a StartMove () method. This sets a
                           _NET_WM_MOVERESIZE_MOVE (on _NET_WM_MOVERESIZE)
                           to the root window, which compiz and other EWMH
                           compliant window managers will receive and
                           initiate a window move with
Added:
 * PanelTitlebarGrabAreaView.cpp / h : New nux widget embedded into panel
                                       which takes up the rest of the remaining
                                       space and handles grab events

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "PanelIndicatorObjectView.h"
28
28
#include "StaticCairoText.h"
29
29
#include "WindowButtons.h"
 
30
#include "PanelTitlebarGrabAreaView.h"
30
31
 
31
32
#include <libbamf/libbamf.h>
32
33
 
67
68
  void OnWindowMaximized (guint32 xid);
68
69
  void OnWindowRestored  (guint32 xid);
69
70
 
 
71
  void OnMaximizedGrab (int x, int y);
 
72
 
70
73
  void Refresh ();
71
74
  void AllMenusClosed ();
72
75
  
93
96
  nux::BaseTexture        *_title_tex;
94
97
 
95
98
  bool _is_inside;
 
99
  bool _is_grabbed;
96
100
  bool _is_maximized; 
97
101
  PanelIndicatorObjectEntryView *_last_active_view;
98
102
 
99
 
  WindowButtons *_window_buttons;
 
103
  WindowButtons * _window_buttons;
 
104
  PanelTitlebarGrabArea * _panel_titlebar_grab_area;
100
105
 
101
106
  std::map<guint32, bool> _decor_map;
102
107
};