GDK W32: Re-implement AeroSnap for CSD windows
It works exactly like AeroSnap. Except for shift+win+left/right, which is left for AeroSnap to handle (AeroSnap takes action before we get the message, so there's no way for us to override it). The only thing that doesn't work is shift+win+left/right on a maximized window, for reasons unknown at the moment. This only implements winkey+stuff behaviour of AeroSnap, not the drag-to-the-edge-and-something-funny-happens one. https://bugzilla.gnome.org/show_bug.cgi?id=763013
This commit is contained in:
@ -46,6 +46,44 @@ typedef struct _GdkWindowImplWin32Class GdkWindowImplWin32Class;
|
||||
#define GDK_IS_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WIN32))
|
||||
#define GDK_WINDOW_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class))
|
||||
|
||||
enum _GdkWin32AeroSnapCombo
|
||||
{
|
||||
GDK_WIN32_AEROSNAP_COMBO_NOTHING = 0,
|
||||
GDK_WIN32_AEROSNAP_COMBO_UP,
|
||||
GDK_WIN32_AEROSNAP_COMBO_DOWN,
|
||||
GDK_WIN32_AEROSNAP_COMBO_LEFT,
|
||||
GDK_WIN32_AEROSNAP_COMBO_RIGHT,
|
||||
/* Same order as non-shift variants. We use it to do things like:
|
||||
* AEROSNAP_UP + 4 = AEROSNAP_SHIFTUP
|
||||
*/
|
||||
GDK_WIN32_AEROSNAP_COMBO_SHIFTUP,
|
||||
GDK_WIN32_AEROSNAP_COMBO_SHIFTDOWN,
|
||||
GDK_WIN32_AEROSNAP_COMBO_SHIFTLEFT,
|
||||
GDK_WIN32_AEROSNAP_COMBO_SHIFTRIGHT
|
||||
};
|
||||
|
||||
typedef enum _GdkWin32AeroSnapCombo GdkWin32AeroSnapCombo;
|
||||
|
||||
enum _GdkWin32AeroSnapState
|
||||
{
|
||||
GDK_WIN32_AEROSNAP_STATE_UNDETERMINED = 0,
|
||||
GDK_WIN32_AEROSNAP_STATE_HALFLEFT,
|
||||
GDK_WIN32_AEROSNAP_STATE_HALFRIGHT,
|
||||
GDK_WIN32_AEROSNAP_STATE_FULLUP,
|
||||
};
|
||||
|
||||
typedef enum _GdkWin32AeroSnapState GdkWin32AeroSnapState;
|
||||
|
||||
struct _GdkRectangleDouble
|
||||
{
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
};
|
||||
|
||||
typedef struct _GdkRectangleDouble GdkRectangleDouble;
|
||||
|
||||
enum _GdkW32WindowDragOp
|
||||
{
|
||||
GDK_WIN32_DRAGOP_NONE = 0,
|
||||
@ -173,6 +211,19 @@ struct _GdkWindowImplWin32
|
||||
|
||||
GdkW32DragMoveResizeContext drag_move_resize_context;
|
||||
|
||||
/* Remembers where the window was snapped.
|
||||
* Some snap operations change their meaning if
|
||||
* the window is already snapped.
|
||||
*/
|
||||
GdkWin32AeroSnapState snap_state;
|
||||
|
||||
/* Remembers window position before it was snapped.
|
||||
* This is used to unsnap it.
|
||||
* Position and size are percentages of the workarea
|
||||
* of the monitor on which the window was before it was snapped.
|
||||
*/
|
||||
GdkRectangleDouble *snap_stash;
|
||||
|
||||
/* Decorations set by gdk_window_set_decorations() or NULL if unset */
|
||||
GdkWMDecoration* decorations;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user