window: Add getters for fullscreen and maximized state
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 10 Oct 2012 15:36:24 +0000 (11:36 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 10 Oct 2012 15:36:24 +0000 (11:36 -0400)
This lets us eliminate a bit of redundancy in the clienst where they track
fullscreen state themselves.

clients/window.c
clients/window.h

index 4df771d..1529dac 100644 (file)
@@ -2979,6 +2979,12 @@ window_schedule_redraw(struct window *window)
        }
 }
 
+int
+window_is_fullscreen(struct window *window)
+{
+       return window->type == TYPE_FULLSCREEN;
+}
+
 void
 window_set_fullscreen(struct window *window, int fullscreen)
 {
@@ -3003,6 +3009,12 @@ window_set_fullscreen(struct window *window, int fullscreen)
        }
 }
 
+int
+window_is_maximized(struct window *window)
+{
+       return window->type == TYPE_MAXIMIZED;
+}
+
 void
 window_set_maximized(struct window *window, int maximized)
 {
index 41f63da..0c09c68 100644 (file)
@@ -281,9 +281,15 @@ display_surface_damage(struct display *display, cairo_surface_t *cairo_surface,
 void
 window_set_buffer_type(struct window *window, enum window_buffer_type type);
 
+int
+window_is_fullscreen(struct window *window);
+
 void
 window_set_fullscreen(struct window *window, int fullscreen);
 
+int
+window_is_maximized(struct window *window);
+
 void
 window_set_maximized(struct window *window, int maximized);