1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 /**
4  * \file window-private.h  Windows which Marco manages
5  *
6  * Managing X windows.
7  * This file contains methods on this class which are available to
8  * routines in core but not outside it.  (See window.h for the routines
9  * which the rest of the world is allowed to use.)
10  */
11 
12 /*
13  * Copyright (C) 2001 Havoc Pennington
14  * Copyright (C) 2002 Red Hat, Inc.
15  * Copyright (C) 2003, 2004 Rob Adams
16  * Copyright (C) 2004-2006 Elijah Newren
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License as
20  * published by the Free Software Foundation; either version 2 of the
21  * License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful, but
24  * WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26  * General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
31  * 02110-1301, USA.
32  */
33 
34 #ifndef META_WINDOW_PRIVATE_H
35 #define META_WINDOW_PRIVATE_H
36 
37 #include <config.h>
38 #include "window.h"
39 #include "screen-private.h"
40 #include "util.h"
41 #include "stack.h"
42 #include "iconcache.h"
43 #include <X11/Xutil.h>
44 #include <cairo.h>
45 #include <gdk-pixbuf/gdk-pixbuf.h>
46 #include <gtk/gtk.h>
47 
48 G_BEGIN_DECLS
49 
50 typedef struct _MetaGroup MetaGroup;
51 typedef struct _MetaWindowQueue MetaWindowQueue;
52 
53 typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
54                                            void       *data);
55 
56 typedef enum
57 {
58   META_WINDOW_NORMAL,
59   META_WINDOW_DESKTOP,
60   META_WINDOW_DOCK,
61   META_WINDOW_DIALOG,
62   META_WINDOW_MODAL_DIALOG,
63   META_WINDOW_TOOLBAR,
64   META_WINDOW_MENU,
65   META_WINDOW_UTILITY,
66   META_WINDOW_SPLASHSCREEN
67 } MetaWindowType;
68 
69 typedef enum
70 {
71   META_MAXIMIZE_HORIZONTAL = 1 << 0,
72   META_MAXIMIZE_VERTICAL   = 1 << 1
73 } MetaMaximizeFlags;
74 
75 typedef enum {
76   META_CLIENT_TYPE_UNKNOWN = 0,
77   META_CLIENT_TYPE_APPLICATION = 1,
78   META_CLIENT_TYPE_PAGER = 2,
79   META_CLIENT_TYPE_MAX_RECOGNIZED = 2
80 } MetaClientType;
81 
82 typedef enum {
83   META_QUEUE_CALC_SHOWING = 1 << 0,
84   META_QUEUE_MOVE_RESIZE  = 1 << 1,
85   META_QUEUE_UPDATE_ICON  = 1 << 2,
86 } MetaQueueType;
87 
88 typedef enum {
89   META_TILE_CYCLE_NONE,
90   META_TILE_CYCLE_50,
91   META_TILE_CYCLE_33,
92   META_TILE_CYCLE_25,
93   META_TILE_CYCLE_100,
94   META_TILE_CYCLE_75,
95   META_TILE_CYCLE_66
96 } MetaTileCycle;
97 
98 #define NUMBER_OF_QUEUES 3
99 
100 struct _MetaWindow
101 {
102   GObject parent;
103 
104   MetaDisplay *display;
105   MetaScreen *screen;
106   MetaWorkspace *workspace;
107   Window xwindow;
108   /* may be NULL! not all windows get decorated */
109   MetaFrame *frame;
110   int depth;
111   Visual *xvisual;
112   Colormap colormap;
113   char *desc; /* used in debug spew */
114   char *title;
115 
116   char *icon_name;
117   GdkPixbuf *icon;
118   GdkPixbuf *mini_icon;
119   MetaIconCache icon_cache;
120   Pixmap wm_hints_pixmap;
121   Pixmap wm_hints_mask;
122 
123   MetaWindowType type;
124   Atom type_atom;
125 
126   /* NOTE these five are not in UTF-8, we just treat them as random
127    * binary data
128    */
129   char *res_class;
130   char *res_name;
131   char *role;
132   char *sm_client_id;
133   char *wm_client_machine;
134   char *startup_id;
135   char *gtk_theme_variant;
136 
137   int net_wm_pid;
138 
139   Window xtransient_for;
140   Window xgroup_leader;
141   Window xclient_leader;
142 
143   /* Initial workspace property */
144   int initial_workspace;
145 
146   /* Initial timestamp property */
147   guint32 initial_timestamp;
148 
149   /* Whether we're maximized */
150   guint maximized_horizontally : 1;
151   guint maximized_vertically : 1;
152 
153   /* Whether we have to maximize/minimize after placement */
154   guint maximize_horizontally_after_placement : 1;
155   guint maximize_vertically_after_placement : 1;
156   guint minimize_after_placement : 1;
157 
158   /* Whether to move after placement */
159   guint move_after_placement : 1;
160 
161   /* The current or requested tile mode. If maximized_vertically is true,
162    * this is the current mode. If not, it is the mode which will be
163    * requested after the window grab is released */
164   guint tile_mode : 3;
165   guint tile_resized : 1;
166   guint tiled : 1;
167   guint tile_cycle : 3;
168 
169   /* The last "full" maximized/unmaximized state. We need to keep track of
170    * that to toggle between normal/tiled or maximized/tiled states. */
171   guint saved_maximize : 1;
172   int tile_monitor_number;
173 
174   /* Whether we're shaded */
175   guint shaded : 1;
176 
177   /* Whether we're fullscreen */
178   guint fullscreen : 1;
179 
180   /* Whether we have to fullscreen after placement */
181   guint fullscreen_after_placement : 1;
182 
183   /* Area to cover when in fullscreen mode.  If _NET_WM_FULLSCREEN_MONITORS has
184    * been overridden (via a client message), the window will cover the union of
185    * these monitors.  If not, this is the single monitor which the window's
186    * origin is on. */
187   long fullscreen_monitors[4];
188 
189   /* Whether we're trying to constrain the window to be fully onscreen */
190   guint require_fully_onscreen : 1;
191 
192   /* Whether we're trying to constrain the window to be on a single xinerama */
193   guint require_on_single_xinerama : 1;
194 
195   /* Whether we're trying to constrain the window's titlebar to be onscreen */
196   guint require_titlebar_visible : 1;
197 
198   /* Whether we're sticky in the multi-workspace sense
199    * (vs. the not-scroll-with-viewport sense, we don't
200    * have no stupid viewports)
201    */
202   guint on_all_workspaces : 1;
203 
204   /* Minimize is the state controlled by the minimize button */
205   guint minimized : 1;
206   guint was_minimized : 1;
207   guint tab_unminimized : 1;
208 
209   /* Whether the window is mapped; actual server-side state
210    * see also unmaps_pending
211    */
212   guint mapped : 1;
213 
214   /* Iconic is the state in WM_STATE; happens for workspaces/shading
215    * in addition to minimize
216    */
217   guint iconic : 1;
218   /* initially_iconic is the WM_HINTS setting when we first manage
219    * the window. It's taken to mean initially minimized.
220    */
221   guint initially_iconic : 1;
222 
223   /* whether an initial workspace was explicitly set */
224   guint initial_workspace_set : 1;
225 
226   /* whether an initial timestamp was explicitly set */
227   guint initial_timestamp_set : 1;
228 
229   /* whether net_wm_user_time has been set yet */
230   guint net_wm_user_time_set : 1;
231 
232   /* These are the flags from WM_PROTOCOLS */
233   guint take_focus : 1;
234   guint delete_window : 1;
235   guint net_wm_ping : 1;
236   /* Globally active / No input */
237   guint input : 1;
238 
239   /* MWM hints about features of window */
240   guint mwm_decorated : 1;
241   guint mwm_border_only : 1;
242   guint mwm_has_close_func : 1;
243   guint mwm_has_minimize_func : 1;
244   guint mwm_has_maximize_func : 1;
245   guint mwm_has_move_func : 1;
246   guint mwm_has_resize_func : 1;
247 
248   /* Computed features of window */
249   guint decorated : 1;
250   guint border_only : 1;
251   guint always_sticky : 1;
252   guint has_close_func : 1;
253   guint has_minimize_func : 1;
254   guint has_maximize_func : 1;
255   guint has_shade_func : 1;
256   guint has_move_func : 1;
257   guint has_resize_func : 1;
258   guint has_fullscreen_func : 1;
259 
260   /* Weird "_NET_WM_STATE_MODAL" flag */
261   guint wm_state_modal : 1;
262 
263   /* TRUE if the client forced these on */
264   guint wm_state_skip_taskbar : 1;
265   guint wm_state_skip_pager : 1;
266 
267   /* Computed whether to skip taskbar or not */
268   guint skip_taskbar : 1;
269   guint skip_pager : 1;
270 
271   /* TRUE if client set these */
272   guint wm_state_above : 1;
273   guint wm_state_below : 1;
274 
275   /* EWHH demands attention flag */
276   guint wm_state_demands_attention : 1;
277 
278   /* this flag tracks receipt of focus_in focus_out and
279    * determines whether we draw the focus
280    */
281   guint has_focus : 1;
282 
283   /* Have we placed this window? */
284   guint placed : 1;
285 
286   /* Must we force_save_user_window_placement? */
287   guint force_save_user_rect : 1;
288 
289   /* Is this not a transient of the focus window which is being denied focus? */
290   guint denied_focus_and_not_transient : 1;
291 
292   /* Has this window not ever been shown yet? */
293   guint showing_for_first_time : 1;
294 
295   /* Are we in meta_window_free()? */
296   guint unmanaging : 1;
297 
298   /* Are we in meta_window_new()? */
299   guint constructing : 1;
300 
301   /* Are we in the various queues? (Bitfield: see META_WINDOW_IS_IN_QUEUE) */
302   guint is_in_queues : NUMBER_OF_QUEUES;
303 
304   /* Used by keybindings.c */
305   guint keys_grabbed : 1;     /* normal keybindings grabbed */
306   guint grab_on_frame : 1;    /* grabs are on the frame */
307   guint all_keys_grabbed : 1; /* AnyKey grabbed */
308 
309   /* Set if the reason for unmanaging the window is that
310    * it was withdrawn
311    */
312   guint withdrawn : 1;
313 
314   /* TRUE if constrain_position should calc placement.
315    * only relevant if !window->placed
316    */
317   guint calc_placement : 1;
318 
319   /* Transient parent is a root window */
320   guint transient_parent_is_root_window : 1;
321 
322   /* Info on which props we got our attributes from */
323   guint using_net_wm_name              : 1; /* vs. plain wm_name */
324   guint using_net_wm_visible_name      : 1; /* tracked so we can clear it */
325   guint using_net_wm_icon_name         : 1; /* vs. plain wm_icon_name */
326   guint using_net_wm_visible_icon_name : 1; /* tracked so we can clear it */
327 
328   /* has a shape mask */
329   guint has_shape : 1;
330 
331   /* icon props have changed */
332   guint need_reread_icon : 1;
333 
334   /* if TRUE, window was maximized at start of current grab op */
335   guint shaken_loose : 1;
336 
337   /* if TRUE we have a grab on the focus click buttons */
338   guint have_focus_click_grab : 1;
339 
340   /* if TRUE, application is buggy and SYNC resizing is turned off */
341   guint disable_sync : 1;
342 
343   /* if non-NULL, the bounds of the window frame */
344   cairo_region_t *frame_bounds;
345 
346   /* Note: can be NULL */
347   GSList *struts;
348 
349 #ifdef HAVE_XSYNC
350   /* XSync update counter */
351   XSyncCounter sync_request_counter;
352   guint sync_request_serial;
353   gint64 sync_request_time;
354 #endif
355 
356   /* Number of UnmapNotify that are caused by us, if
357    * we get UnmapNotify with none pending then the client
358    * is withdrawing the window.
359    */
360   int unmaps_pending;
361 
362   /* set to the most recent user-interaction event timestamp that we
363      know about for this window */
364   guint32 net_wm_user_time;
365 
366   /* window that gets updated net_wm_user_time values */
367   Window user_time_window;
368 
369   /* The size we set the window to last (i.e. what we believe
370    * to be its actual size on the server). The x, y are
371    * the actual server-side x,y so are relative to the frame
372    * (meaning that they just hold the frame width and height)
373    * or the root window (meaning they specify the location
374    * of the top left of the inner window) as appropriate.
375    */
376   MetaRectangle rect;
377 
378   gboolean has_custom_frame_extents;
379   GtkBorder custom_frame_extents;
380 
381   /* The geometry to restore when we unmaximize.  The position is in
382    * root window coords, even if there's a frame, which contrasts with
383    * window->rect above.  Note that this gives the position and size
384    * of the client window (i.e. ignoring the frame).
385    */
386   MetaRectangle saved_rect;
387 
388   /* This is the geometry the window had after the last user-initiated
389    * move/resize operations. We use this whenever we are moving the
390    * implicitly (for example, if we move to avoid a panel, we can snap
391    * back to this position if the panel moves again).  Note that this
392    * gives the position and size of the client window (i.e. ignoring
393    * the frame).
394    *
395    * Position valid if user_has_moved, size valid if user_has_resized
396    *
397    * Position always in root coords, unlike window->rect.
398    */
399   MetaRectangle user_rect;
400 
401   /* Requested geometry */
402   int border_width;
403   /* x/y/w/h here get filled with ConfigureRequest values */
404   XSizeHints size_hints;
405 
406   /* Managed by stack.c */
407   MetaStackLayer layer;
408   int stack_position; /* see comment in stack.h */
409 
410   /* Current dialog open for this window */
411   int dialog_pid;
412 
413   /* maintained by group.c */
414   MetaGroup *group;
415 };
416 
417 /* These differ from window->has_foo_func in that they consider
418  * the dynamic window state such as "maximized", not just the
419  * window's type
420  */
421 #define META_WINDOW_MAXIMIZED(w)       ((w)->maximized_horizontally && \
422                                         (w)->maximized_vertically)
423 #define META_WINDOW_MAXIMIZED_VERTICALLY(w)    ((w)->maximized_vertically)
424 #define META_WINDOW_MAXIMIZED_HORIZONTALLY(w)  ((w)->maximized_horizontally)
425 #define META_WINDOW_SIDE_TILED(w)           ((w)->tiled &&              \
426                                              ((w)->tile_mode == META_TILE_LEFT || \
427                                               (w)->tile_mode == META_TILE_RIGHT))
428 #define META_WINDOW_TILED_LEFT(w) (META_WINDOW_SIDE_TILED(w) &&         \
429                                    (w)->tile_mode == META_TILE_LEFT)
430 #define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_SIDE_TILED(w) && \
431                                     (w)->tile_mode == META_TILE_RIGHT)
432 #define META_WINDOW_CORNER_TILED(w) ((w)->tiled &&                      \
433                                      ((w)->tile_mode == META_TILE_BOTTOM_RIGHT || \
434                                       (w)->tile_mode == META_TILE_BOTTOM_LEFT || \
435                                       (w)->tile_mode == META_TILE_TOP_RIGHT || \
436                                       (w)->tile_mode == META_TILE_TOP_LEFT))
437 #define META_WINDOW_TILED(w) (META_WINDOW_SIDE_TILED(w) || META_WINDOW_CORNER_TILED(w))
438 #define META_WINDOW_ALLOWS_MOVE(w)     ((w)->has_move_func && !(w)->fullscreen)
439 #define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w)   ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !(w)->fullscreen && !(w)->shaded)
440 #define META_WINDOW_ALLOWS_RESIZE(w)   (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) &&                \
441                                         (((w)->size_hints.min_width < (w)->size_hints.max_width) ||  \
442                                          ((w)->size_hints.min_height < (w)->size_hints.max_height)))
443 #define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width)
444 #define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w)   (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && !META_WINDOW_SIDE_TILED(w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
445 
446 MetaWindow* meta_window_new                (MetaDisplay *display,
447                                             Window       xwindow,
448                                             gboolean     must_be_viewable);
449 MetaWindow* meta_window_new_with_attrs     (MetaDisplay *display,
450                                             Window       xwindow,
451                                             gboolean     must_be_viewable,
452                                             XWindowAttributes *attrs);
453 void        meta_window_free               (MetaWindow  *window,
454                                             guint32      timestamp);
455 void        meta_window_calc_showing       (MetaWindow  *window);
456 void        meta_window_queue              (MetaWindow  *window,
457                                             guint queuebits);
458 void        meta_window_tile               (MetaWindow  *window);
459 void        meta_window_untile               (MetaWindow  *window);
460 void        meta_window_minimize           (MetaWindow  *window);
461 void        meta_window_unminimize         (MetaWindow  *window);
462 void        meta_window_maximize           (MetaWindow        *window,
463                                             MetaMaximizeFlags  directions);
464 void        meta_window_maximize_internal  (MetaWindow        *window,
465                                             MetaMaximizeFlags  directions,
466                                             MetaRectangle     *saved_rect);
467 void        meta_window_unmaximize         (MetaWindow        *window,
468                                             MetaMaximizeFlags  directions);
469 void        meta_window_move_to_monitor    (MetaWindow *window,
470                                             const MetaXineramaScreenInfo *from_monitor,
471                                             const MetaXineramaScreenInfo *to_monitor);
472 void        meta_window_make_above         (MetaWindow  *window);
473 void        meta_window_unmake_above       (MetaWindow  *window);
474 void        meta_window_shade              (MetaWindow  *window,
475                                             guint32      timestamp);
476 void        meta_window_unshade            (MetaWindow  *window,
477                                             guint32      timestamp);
478 void        meta_window_change_workspace   (MetaWindow  *window,
479                                             MetaWorkspace *workspace);
480 void        meta_window_stick              (MetaWindow  *window);
481 void        meta_window_unstick            (MetaWindow  *window);
482 
483 void        meta_window_activate           (MetaWindow  *window,
484                                             guint32      current_time);
485 void        meta_window_activate_with_workspace  (MetaWindow    *window,
486                                                   guint32        current_time,
487                                                   MetaWorkspace *workspace);
488 void        meta_window_make_fullscreen_internal (MetaWindow    *window);
489 void        meta_window_make_fullscreen    (MetaWindow  *window);
490 void        meta_window_unmake_fullscreen  (MetaWindow  *window);
491 void        meta_window_update_fullscreen_monitors (MetaWindow    *window,
492                                                     unsigned long  top,
493                                                     unsigned long  bottom,
494                                                     unsigned long  left,
495                                                     unsigned long  right);
496 
497 gboolean    meta_window_appears_focused    (MetaWindow *window);
498 
499 /* args to move are window pos, not frame pos */
500 void        meta_window_move               (MetaWindow  *window,
501                                             gboolean     user_op,
502                                             int          root_x_nw,
503                                             int          root_y_nw);
504 void        meta_window_resize             (MetaWindow  *window,
505                                             gboolean     user_op,
506                                             int          w,
507                                             int          h);
508 void        meta_window_move_resize        (MetaWindow  *window,
509                                             gboolean     user_op,
510                                             int          root_x_nw,
511                                             int          root_y_nw,
512                                             int          w,
513                                             int          h);
514 void        meta_window_resize_with_gravity (MetaWindow  *window,
515                                              gboolean     user_op,
516                                              int          w,
517                                              int          h,
518                                              int          gravity);
519 
520 /* Return whether the window would be showing if we were on its workspace */
521 gboolean    meta_window_showing_on_its_workspace (MetaWindow *window);
522 
523 /* Return whether the window should be currently mapped */
524 gboolean    meta_window_should_be_showing   (MetaWindow  *window);
525 
526 /* See warning in window.c about this function */
527 gboolean    __window_is_terminal (MetaWindow *window);
528 
529 void        meta_window_update_struts      (MetaWindow  *window);
530 
531 /* this gets root coords */
532 void        meta_window_get_position       (MetaWindow  *window,
533                                             int         *x,
534                                             int         *y);
535 
536 /* Gets root coords for x, y, width & height of client window; uses
537  * meta_window_get_position for x & y.
538  */
539 void        meta_window_get_client_root_coords (MetaWindow    *window,
540                                                 MetaRectangle *rect);
541 
542 /* gets position we need to set to stay in current position,
543  * assuming position will be gravity-compensated. i.e.
544  * this is the position a client would send in a configure
545  * request.
546  */
547 void        meta_window_get_gravity_position (MetaWindow  *window,
548                                               int          gravity,
549                                               int         *x,
550                                               int         *y);
551 /* Get geometry for saving in the session; x/y are gravity
552  * position, and w/h are in resize inc above the base size.
553  */
554 void        meta_window_get_geometry         (MetaWindow  *window,
555                                               int         *x,
556                                               int         *y,
557                                               int         *width,
558                                               int         *height);
559 void        meta_window_get_input_rect       (const MetaWindow *window,
560                                               MetaRectangle    *rect);
561 void        meta_window_get_outer_rect       (const MetaWindow *window,
562                                               MetaRectangle    *rect);
563 void        meta_window_get_xor_rect         (MetaWindow          *window,
564                                               const MetaRectangle *grab_wireframe_rect,
565                                               MetaRectangle       *xor_rect);
566 void        meta_window_begin_wireframe (MetaWindow *window);
567 void        meta_window_update_wireframe (MetaWindow *window,
568                                           int         x,
569                                           int         y,
570                                           int         width,
571                                           int         height);
572 void        meta_window_end_wireframe (MetaWindow *window);
573 
574 void        meta_window_delete             (MetaWindow  *window,
575                                             guint32      timestamp);
576 void        meta_window_kill               (MetaWindow  *window);
577 void        meta_window_focus              (MetaWindow  *window,
578                                             guint32      timestamp);
579 void        meta_window_raise              (MetaWindow  *window);
580 void        meta_window_lower              (MetaWindow  *window);
581 
582 void        meta_window_update_unfocused_button_grabs (MetaWindow *window);
583 
584 /* Sends a client message */
585 void meta_window_send_icccm_message (MetaWindow *window,
586                                      Atom        atom,
587                                      guint32     timestamp);
588 
589 void     meta_window_move_resize_request(MetaWindow *window,
590                                          guint       value_mask,
591                                          int         gravity,
592                                          int         x,
593                                          int         y,
594                                          int         width,
595                                          int         height);
596 gboolean meta_window_configure_request (MetaWindow *window,
597                                         XEvent     *event);
598 gboolean meta_window_property_notify   (MetaWindow *window,
599                                         XEvent     *event);
600 gboolean meta_window_client_message    (MetaWindow *window,
601                                         XEvent     *event);
602 gboolean meta_window_notify_focus      (MetaWindow *window,
603                                         XEvent     *event);
604 
605 void     meta_window_set_current_workspace_hint (MetaWindow *window);
606 
607 unsigned long meta_window_get_net_wm_desktop (MetaWindow *window);
608 
609 void meta_window_show_menu (MetaWindow *window,
610                             int         root_x,
611                             int         root_y,
612                             int         button,
613                             guint32     timestamp);
614 
615 gboolean meta_window_titlebar_is_onscreen    (MetaWindow *window);
616 void     meta_window_shove_titlebar_onscreen (MetaWindow *window);
617 
618 void meta_window_set_gravity (MetaWindow *window,
619                               int         gravity);
620 
621 void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
622                                              XEvent     *event);
623 
624 MetaWorkspace *
625 meta_window_get_workspace (MetaWindow *window);
626 
627 GList* meta_window_get_workspaces (MetaWindow *window);
628 
629 gboolean meta_window_located_on_workspace (MetaWindow    *window,
630                                            MetaWorkspace *workspace);
631 
632 void meta_window_get_work_area_current_xinerama (MetaWindow    *window,
633                                                  MetaRectangle *area);
634 void meta_window_get_work_area_for_xinerama     (MetaWindow    *window,
635                                                  int            which_xinerama,
636                                                  MetaRectangle *area);
637 void meta_window_get_work_area_all_xineramas    (MetaWindow    *window,
638                                                  MetaRectangle *area);
639 
640 void meta_window_get_current_tile_area         (MetaWindow    *window,
641                                                 MetaRectangle *tile_area);
642 
643 gboolean meta_window_same_application (MetaWindow *window,
644                                        MetaWindow *other_window);
645 
646 #define META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE(w) \
647   ((w)->type != META_WINDOW_DOCK && (w)->type != META_WINDOW_DESKTOP)
648 #define META_WINDOW_IN_NORMAL_TAB_CHAIN(w) \
649   (((w)->input || (w)->take_focus ) && META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w) && (!(w)->skip_taskbar))
650 #define META_WINDOW_IN_DOCK_TAB_CHAIN(w) \
651   (((w)->input || (w)->take_focus) && (! META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE (w) || (w)->skip_taskbar))
652 #define META_WINDOW_IN_GROUP_TAB_CHAIN(w, g) \
653   (((w)->input || (w)->take_focus) && (!g || meta_window_get_group(w)==g))
654 
655 void meta_window_refresh_resize_popup (MetaWindow *window);
656 
657 void meta_window_free_delete_dialog (MetaWindow *window);
658 
659 void     meta_window_foreach_transient        (MetaWindow            *window,
660                                                MetaWindowForeachFunc  func,
661                                                void                  *data);
662 gboolean meta_window_is_ancestor_of_transient (MetaWindow            *window,
663                                                MetaWindow            *transient);
664 void     meta_window_foreach_ancestor         (MetaWindow            *window,
665                                                MetaWindowForeachFunc  func,
666                                                void                  *data);
667 MetaWindow* meta_window_find_root_ancestor    (MetaWindow *window);
668 
669 void meta_window_begin_grab_op (MetaWindow *window,
670                                 MetaGrabOp  op,
671                                 gboolean    frame_action,
672                                 guint32     timestamp);
673 
674 void meta_window_update_keyboard_resize (MetaWindow *window,
675                                          gboolean    update_cursor);
676 void meta_window_update_keyboard_move   (MetaWindow *window);
677 
678 void meta_window_update_layer (MetaWindow *window);
679 
680 gboolean meta_window_get_icon_geometry (MetaWindow    *window,
681                                         MetaRectangle *rect);
682 
683 const char* meta_window_get_startup_id (MetaWindow *window);
684 
685 void meta_window_recalc_features    (MetaWindow *window);
686 void meta_window_recalc_window_type (MetaWindow *window);
687 
688 void meta_window_stack_just_below (MetaWindow *window,
689                                    MetaWindow *below_this_one);
690 
691 void meta_window_set_user_time (MetaWindow *window,
692                                 guint32     timestamp);
693 
694 void meta_window_set_demands_attention (MetaWindow *window);
695 
696 void meta_window_unset_demands_attention (MetaWindow *window);
697 
698 void meta_window_update_icon_now (MetaWindow *window);
699 
700 gboolean meta_window_is_client_decorated (MetaWindow *window);
701 
702 void meta_window_update_role (MetaWindow *window);
703 void meta_window_update_net_wm_type (MetaWindow *window);
704 
705 gboolean meta_window_can_tile (MetaWindow *window);
706 
707 G_END_DECLS
708 
709 #endif /* META_WINDOW_PRIVATE_H */
710