1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 #ifndef META_COMPOSITOR_PRIVATE_H
4 #define META_COMPOSITOR_PRIVATE_H
5 
6 #include <X11/extensions/Xfixes.h>
7 
8 #include <meta/compositor.h>
9 #include <meta/display.h>
10 #include "meta-plugin-manager.h"
11 #include "meta-window-actor-private.h"
12 #include <clutter/clutter.h>
13 
14 struct _MetaCompositor
15 {
16   MetaDisplay    *display;
17   MetaScreen     *screen;
18 
19   Atom            atom_x_root_pixmap;
20   Atom            atom_x_set_root;
21   Atom            atom_net_wm_window_opacity;
22   guint           pre_paint_func_id;
23   guint           post_paint_func_id;
24 
25   ClutterActor   *stage, *shadow_src;
26   ClutterActor   *bottom_window_group, *window_group, *overlay_group, *top_window_group;
27   ClutterActor   *background_actor;
28   ClutterActor   *hidden_group;
29 
30   GList          *windows;
31 
32   MetaWindowActor *unredirected_window;
33 
34   CoglContext    *context;
35 
36   Window          output;
37 
38   /* Used for unredirecting fullscreen windows */
39   guint           disable_unredirect_count;
40 
41   /* Before we create the output window */
42   XserverRegion   pending_input_region;
43 
44   gint            switch_workspace_in_progress;
45 
46   MetaPluginManager *plugin_mgr;
47 
48   MetaPlugin     *modal_plugin;
49 
50   gint64          server_time_query_time;
51   gint64          server_time_offset;
52 
53   guint           server_time_is_monotonic_time : 1;
54   guint           show_redraw : 1;
55   guint           debug       : 1;
56   guint           no_mipmaps  : 1;
57 
58   gboolean frame_has_updated_xsurfaces;
59   gboolean have_x11_sync_object;
60 };
61 
62 /* Wait 2ms after vblank before starting to draw next frame */
63 #define META_SYNC_DELAY 0
64 
65 CoglContext * meta_compositor_get_cogl_context (void);
66 
67 void meta_switch_workspace_completed (MetaScreen    *screen);
68 
69 gboolean meta_begin_modal_for_plugin (MetaScreen       *screen,
70                                       MetaPlugin       *plugin,
71                                       Window            grab_window,
72                                       Cursor            cursor,
73                                       MetaModalOptions  options,
74                                       guint32           timestamp);
75 void     meta_end_modal_for_plugin   (MetaScreen       *screen,
76                                       MetaPlugin       *plugin,
77                                       guint32           timestamp);
78 
79 gint64 meta_compositor_monotonic_time_to_server_time (MetaDisplay *display,
80                                                       gint64       monotonic_time);
81 
82 void meta_compositor_grab_op_begin (MetaCompositor *compositor);
83 void meta_compositor_grab_op_end (MetaCompositor *compositor);
84 
85 void meta_check_end_modal (MetaScreen *screen);
86 
87 void meta_compositor_update_sync_state (MetaCompositor *compositor,
88                                         MetaSyncMethod  method);
89 
90 #endif /* META_COMPOSITOR_PRIVATE_H */
91