summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-07-03 02:32:40 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-07-03 02:32:40 +0000
commitd826e620a9719527c535aa6c5e5d11ebeaa0afd5 (patch)
tree77f284adfe4549efb71adb7dbd105db09812e350 /src/window.h
parent1db28d3b3fbf93abc54477d82270471f180057fd (diff)
downloadmetacity-d826e620a9719527c535aa6c5e5d11ebeaa0afd5.tar.gz
metacity-d826e620a9719527c535aa6c5e5d11ebeaa0afd5.tar.bz2
use new macros to get whether we allow move/resize correct
2002-07-02 Havoc Pennington <hp@pobox.com> * src/window.c (meta_window_show_menu): use new macros to get whether we allow move/resize correct * src/frame.c (meta_frame_get_flags): use new macros to get whether we can move/resize correct, considering maximized/fullscreen for the move case. * src/window.h (META_WINDOW_ALLOWS_RESIZE, META_WINDOW_ALLOWS_MOVE): new macros * src/keybindings.c (process_keyboard_resize_grab): finish the right/left resize, patch from Jayaraj #78179. Has the same old move/resize bug, if it hits a constraint it starts to break because we move without resizing.
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
index 4794677..a3e8df5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -252,6 +252,14 @@ struct _MetaWindow
int dialog_pipe;
};
+#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->maximized && !(w)->fullscreen)
+#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !(w)->maximized && !(w)->fullscreen && !(w)->shaded)
+#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
+ (((w)->size_hints.min_width < (w)->size_hints.max_width) || \
+ ((w)->size_hints.min_height < (w)->size_hints.max_height)))
+#define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width)
+#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
+
MetaWindow* meta_window_new (MetaDisplay *display,
Window xwindow,
gboolean must_be_viewable);