diff --git a/ChangeLog b/ChangeLog index 51c67eec9..45e1a1b14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Thu May 4 13:30:04 2006 Søren Sandmann + + * src/ui.h: Delete unused META_PRIORITY_COMPOSITE + + * src/ui.c: Delete argument from meta_ui_get_display(). + + * src/c-window.c: Remove the xid->window hashtable and associated + code. + + * src/c-screen.[ch]: Rename MetaScreenInfo to MetaCompScreen. Put the + xid->windows table here instaed of as a static variable. Also make + sure that CompWindows are freed when the screen is unredirected. + + * src/display.c: Delete non USE_GDK_DISPLAY case, as it didn't + work and hasn't been compiled for a long time. + + * src/display.[ch] (meta_display_open): Remove argument as it was + always NULL (and couldn't possibly be anything else in the + USE_GDK_DISPLAY case). + Tue May 2 17:12:54 2006 Søren Sandmann * src/c-window.[ch]: New files diff --git a/src/c-screen.c b/src/c-screen.c index 6bc18f9fb..b21ffb1e5 100644 --- a/src/c-screen.c +++ b/src/c-screen.c @@ -33,7 +33,7 @@ #include "c-screen.h" #include "c-window.h" -struct MetaScreenInfo +struct MetaCompScreen { WsDisplay *display; CmStacker *stacker; @@ -49,8 +49,21 @@ struct MetaScreenInfo int idle_id; WsWindow *selection_window; + + GHashTable *windows_by_xid; }; +static MetaCompWindow * +meta_comp_window_lookup (MetaCompScreen *info, + Window xid) +{ + MetaCompWindow *window; + + window = g_hash_table_lookup (info->windows_by_xid, (gpointer)xid); + + return window; +} + #if 0 static void update_frame_counter (void) @@ -99,7 +112,7 @@ dump_stacking_order (GList *nodes) static gboolean repaint (gpointer data) { - MetaScreenInfo *info = data; + MetaCompScreen *info = data; CmState *state; #if 0 g_print ("repaint\n"); @@ -148,17 +161,17 @@ repaint (gpointer data) } static MetaCompWindow * -find_comp_window (MetaScreenInfo *info, +find_comp_window (MetaCompScreen *info, Window xwindow) { - return meta_comp_window_lookup (xwindow); + return meta_comp_window_lookup (info, xwindow); } static CmNode * -find_node (MetaScreenInfo *info, +find_node (MetaCompScreen *info, Window xwindow) { - MetaCompWindow *window = meta_comp_window_lookup (xwindow); + MetaCompWindow *window = meta_comp_window_lookup (info, xwindow); if (window) return meta_comp_window_get_node (window); @@ -168,14 +181,14 @@ find_node (MetaScreenInfo *info, static GList *all_screen_infos; -MetaScreenInfo * -meta_screen_info_get_by_xwindow (Window xwindow) +MetaCompScreen * +meta_comp_screen_get_by_xwindow (Window xwindow) { GList *list; for (list = all_screen_infos; list != NULL; list = list->next) { - MetaScreenInfo *info = list->data; + MetaCompScreen *info = list->data; if (find_node (info, xwindow)) return info; @@ -184,17 +197,18 @@ meta_screen_info_get_by_xwindow (Window xwindow) return NULL; } -MetaScreenInfo * -meta_screen_info_new (WsDisplay *display, +MetaCompScreen * +meta_comp_screen_new (WsDisplay *display, MetaScreen *screen) { - MetaScreenInfo *scr_info = g_new0 (MetaScreenInfo, 1); + MetaCompScreen *scr_info = g_new0 (MetaCompScreen, 1); scr_info->screen = ws_display_get_screen_from_number ( display, screen->number); scr_info->root_window = ws_screen_get_root_window (scr_info->screen); scr_info->display = display; scr_info->meta_screen = screen; + scr_info->windows_by_xid = g_hash_table_new (g_direct_hash, g_direct_equal); all_screen_infos = g_list_prepend (all_screen_infos, scr_info); @@ -202,7 +216,7 @@ meta_screen_info_new (WsDisplay *display, } static char * -make_selection_name (MetaScreenInfo *info) +make_selection_name (MetaCompScreen *info) { char *buffer; @@ -216,18 +230,18 @@ on_selection_clear (WsWindow *window, WsSelectionClearEvent *event, gpointer data) { - MetaScreenInfo *info = data; + MetaCompScreen *info = data; char *buffer = make_selection_name (info); if (strcmp (event->selection, buffer)) { /* We lost the selection */ - meta_screen_info_unredirect (info); + meta_comp_screen_unredirect (info); } } static WsWindow * -claim_selection (MetaScreenInfo *info) +claim_selection (MetaCompScreen *info) { WsWindow *window = ws_window_new (info->root_window); char *buffer = make_selection_name (info); @@ -247,16 +261,16 @@ claim_selection (MetaScreenInfo *info) static void queue_paint (CmNode *node, - MetaScreenInfo *info) + MetaCompScreen *info) { #if 0 g_print ("queueing %s\n", G_OBJECT_TYPE_NAME (node)); #endif - meta_screen_info_queue_paint (info); + meta_comp_screen_queue_paint (info); } void -meta_screen_info_redirect (MetaScreenInfo *info) +meta_comp_screen_redirect (MetaCompScreen *info) { WsWindow *root = ws_screen_get_root_window (info->screen); WsRectangle source; @@ -329,24 +343,46 @@ meta_screen_info_redirect (MetaScreenInfo *info) ws_display_sync (info->display); } +static void +listify (gpointer key, + gpointer value, + gpointer data) +{ + GList **windows = data; + + *windows = g_list_prepend (*windows, (gpointer)value); +} + +static void +free_all_windows (MetaCompScreen *info) +{ + GList *windows = NULL, *list; + + g_hash_table_foreach (info->windows_by_xid, listify, &windows); + + for (list = windows; list != NULL; list = list->next) + { + MetaCompWindow *window = list->data; + + meta_comp_window_free (window); + } + + g_list_free (windows); +} + void -meta_screen_info_unredirect (MetaScreenInfo *info) +meta_comp_screen_unredirect (MetaCompScreen *info) { WsScreen *ws_screen = info->screen; WsWindow *root = ws_screen_get_root_window (ws_screen); -#if 0 - g_print ("unredirecting %lx\n", WS_RESOURCE_XID (root)); -#endif - g_signal_handler_disconnect (info->magnifier, info->repaint_id); g_object_unref (info->magnifier); ws_window_unredirect_subwindows (root); -#if 0 - ws_window_unmap (info->gl_window); -#endif ws_screen_release_gl_window (ws_screen); + + free_all_windows (info); ws_display_sync (info->display); @@ -357,7 +393,7 @@ meta_screen_info_unredirect (MetaScreenInfo *info) } void -meta_screen_info_queue_paint (MetaScreenInfo *info) +meta_comp_screen_queue_paint (MetaCompScreen *info) { #if 0 g_print ("queuing\n"); @@ -367,7 +403,7 @@ meta_screen_info_queue_paint (MetaScreenInfo *info) } void -meta_screen_info_restack (MetaScreenInfo *info, +meta_comp_screen_restack (MetaCompScreen *info, Window window, Window above_this) { @@ -412,7 +448,7 @@ meta_screen_info_restack (MetaScreenInfo *info, } void -meta_screen_info_raise_window (MetaScreenInfo *info, +meta_comp_screen_raise_window (MetaCompScreen *info, Window window) { CmNode *node = find_node (info, window); @@ -422,14 +458,14 @@ meta_screen_info_raise_window (MetaScreenInfo *info, } void -meta_screen_info_set_size (MetaScreenInfo *info, +meta_comp_screen_set_size (MetaCompScreen *info, Window xwindow, gint x, gint y, gint width, gint height) { - MetaCompWindow *comp_window = meta_comp_window_lookup (xwindow); + MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow); if (comp_window) { @@ -463,7 +499,7 @@ print_child_titles (WsWindow *window) } void -meta_screen_info_add_window (MetaScreenInfo *info, +meta_comp_screen_add_window (MetaCompScreen *info, Window xwindow) { WsDrawable *drawable; @@ -471,7 +507,7 @@ meta_screen_info_add_window (MetaScreenInfo *info, ws_display_begin_error_trap (info->display); - comp_window = meta_comp_window_lookup (xwindow); + comp_window = meta_comp_window_lookup (info, xwindow); if (comp_window) goto out; @@ -492,6 +528,8 @@ meta_screen_info_add_window (MetaScreenInfo *info, comp_window = meta_comp_window_new (drawable); + g_hash_table_insert (info->windows_by_xid, (gpointer)WS_RESOURCE_XID (drawable), comp_window); + cm_stacker_add_child (info->stacker, meta_comp_window_get_node (comp_window)); out: @@ -509,10 +547,10 @@ meta_screen_info_add_window (MetaScreenInfo *info, void -meta_screen_info_remove_window (MetaScreenInfo *info, +meta_comp_screen_remove_window (MetaCompScreen *info, Window xwindow) { - MetaCompWindow *comp_window = meta_comp_window_lookup (xwindow); + MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow); if (comp_window) { @@ -520,22 +558,24 @@ meta_screen_info_remove_window (MetaScreenInfo *info, cm_stacker_remove_child (info->stacker, node); meta_comp_window_free (comp_window); + + g_hash_table_remove (info->windows_by_xid, (gpointer)xwindow); } } void -meta_screen_info_set_updates (MetaScreenInfo *info, +meta_comp_screen_set_updates (MetaCompScreen *info, Window xwindow, gboolean updates) { - MetaCompWindow *comp_window = meta_comp_window_lookup (xwindow); + MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow); meta_comp_window_set_updates (comp_window, updates); } void -meta_screen_info_set_patch (MetaScreenInfo *info, +meta_comp_screen_set_patch (MetaCompScreen *info, Window xwindow, CmPoint points[4][4]) { @@ -546,7 +586,7 @@ meta_screen_info_set_patch (MetaScreenInfo *info, } void -meta_screen_info_unset_patch (MetaScreenInfo *info, +meta_comp_screen_unset_patch (MetaCompScreen *info, Window xwindow) { CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); @@ -556,7 +596,7 @@ meta_screen_info_unset_patch (MetaScreenInfo *info, } void -meta_screen_info_set_alpha (MetaScreenInfo *info, +meta_comp_screen_set_alpha (MetaCompScreen *info, Window xwindow, gdouble alpha) { @@ -568,7 +608,7 @@ meta_screen_info_set_alpha (MetaScreenInfo *info, } void -meta_screen_info_get_real_size (MetaScreenInfo *info, +meta_comp_screen_get_real_size (MetaCompScreen *info, Window xwindow, WsRectangle *size) { @@ -581,7 +621,7 @@ meta_screen_info_get_real_size (MetaScreenInfo *info, } void -meta_screen_info_unmap (MetaScreenInfo *info, +meta_comp_screen_unmap (MetaCompScreen *info, Window xwindow) { CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); @@ -595,7 +635,7 @@ meta_screen_info_unmap (MetaScreenInfo *info, } void -meta_screen_info_set_target_rect (MetaScreenInfo *info, +meta_comp_screen_set_target_rect (MetaCompScreen *info, Window xwindow, WsRectangle *rect) { @@ -606,7 +646,7 @@ meta_screen_info_set_target_rect (MetaScreenInfo *info, } void -meta_screen_info_set_explode (MetaScreenInfo *info, +meta_comp_screen_set_explode (MetaCompScreen *info, Window xwindow, gdouble level) { @@ -623,7 +663,7 @@ meta_screen_info_set_explode (MetaScreenInfo *info, } void -meta_screen_info_hide_window (MetaScreenInfo *info, +meta_comp_screen_hide_window (MetaCompScreen *info, Window xwindow) { CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); diff --git a/src/c-screen.h b/src/c-screen.h index 80388941e..0b8b57571 100644 --- a/src/c-screen.h +++ b/src/c-screen.h @@ -1,51 +1,51 @@ #include "screen.h" -typedef struct MetaScreenInfo MetaScreenInfo; +typedef struct MetaCompScreen MetaCompScreen; -MetaScreenInfo *meta_screen_info_new (WsDisplay *display, - MetaScreen *screen); -MetaScreenInfo *meta_screen_info_get_by_xwindow (Window xwindow); -void meta_screen_info_destroy (MetaScreenInfo *scr_info); -void meta_screen_info_redirect (MetaScreenInfo *info); -void meta_screen_info_unredirect (MetaScreenInfo *info); -void meta_screen_info_add_window (MetaScreenInfo *scr_info, - Window xwindow); -void meta_screen_info_remove_window (MetaScreenInfo *scr_info, - Window xwindow); -void meta_screen_info_restack (MetaScreenInfo *scr_info, - Window window, - Window above_this); -void meta_screen_info_set_size (MetaScreenInfo *info, - Window window, - gint x, - gint y, - gint width, - gint height); -void meta_screen_info_raise_window (MetaScreenInfo *scr_info, - Window window); -void meta_screen_info_queue_paint (MetaScreenInfo *info); -void meta_screen_info_set_updates (MetaScreenInfo *info, - Window xwindow, - gboolean updates); -void meta_screen_info_set_patch (MetaScreenInfo *info, - Window xwindow, - CmPoint points[4][4]); -void meta_screen_info_unset_patch (MetaScreenInfo *info, - Window xwindow); -void meta_screen_info_set_alpha (MetaScreenInfo *info, - Window xwindow, - gdouble alpha); -void meta_screen_info_get_real_size (MetaScreenInfo *info, - Window xwindow, - WsRectangle *size); -void meta_screen_info_set_target_rect (MetaScreenInfo *info, - Window xwindow, - WsRectangle *rect); +MetaCompScreen *meta_comp_screen_new (WsDisplay *display, + MetaScreen *screen); +MetaCompScreen *meta_comp_screen_get_by_xwindow (Window xwindow); +void meta_comp_screen_destroy (MetaCompScreen *scr_info); +void meta_comp_screen_redirect (MetaCompScreen *info); +void meta_comp_screen_unredirect (MetaCompScreen *info); +void meta_comp_screen_add_window (MetaCompScreen *scr_info, + Window xwindow); +void meta_comp_screen_remove_window (MetaCompScreen *scr_info, + Window xwindow); +void meta_comp_screen_restack (MetaCompScreen *scr_info, + Window window, + Window above_this); +void meta_comp_screen_set_size (MetaCompScreen *info, + Window window, + gint x, + gint y, + gint width, + gint height); +void meta_comp_screen_raise_window (MetaCompScreen *scr_info, + Window window); +void meta_comp_screen_queue_paint (MetaCompScreen *info); +void meta_comp_screen_set_updates (MetaCompScreen *info, + Window xwindow, + gboolean updates); +void meta_comp_screen_set_patch (MetaCompScreen *info, + Window xwindow, + CmPoint points[4][4]); +void meta_comp_screen_unset_patch (MetaCompScreen *info, + Window xwindow); +void meta_comp_screen_set_alpha (MetaCompScreen *info, + Window xwindow, + gdouble alpha); +void meta_comp_screen_get_real_size (MetaCompScreen *info, + Window xwindow, + WsRectangle *size); +void meta_comp_screen_set_target_rect (MetaCompScreen *info, + Window xwindow, + WsRectangle *rect); +void meta_comp_screen_set_explode (MetaCompScreen *info, + Window xwindow, + gdouble level); +void meta_comp_screen_hide_window (MetaCompScreen *info, + Window xwindow); +void meta_comp_screen_unmap (MetaCompScreen *info, + Window xwindow); -void meta_screen_info_set_explode (MetaScreenInfo *info, - Window xwindow, - gdouble level); -void meta_screen_info_hide_window (MetaScreenInfo *info, - Window xwindow); -void meta_screen_info_unmap (MetaScreenInfo *info, - Window xwindow); diff --git a/src/c-window.c b/src/c-window.c index 2c9ae5a08..53cf22553 100644 --- a/src/c-window.c +++ b/src/c-window.c @@ -30,8 +30,7 @@ #include #include "c-window.h" - -static GHashTable *windows_by_xid; +#include "window.h" struct _MetaCompWindow { @@ -42,22 +41,12 @@ struct _MetaCompWindow WsRectangle size; }; -static void -ensure_hash_table (void) -{ - if (!windows_by_xid) - { - windows_by_xid = g_hash_table_new ( - g_direct_hash, g_direct_equal); - } -} - MetaCompWindow * meta_comp_window_new (WsDrawable *drawable) { MetaCompWindow *window; WsRectangle geometry; - + ws_drawable_query_geometry (drawable, &geometry); window = g_new0 (MetaCompWindow, 1); @@ -66,31 +55,12 @@ meta_comp_window_new (WsDrawable *drawable) window->node = CM_NODE (cm_drawable_node_new (drawable, &geometry)); window->updates = TRUE; - ensure_hash_table (); - - g_hash_table_insert (windows_by_xid, (gpointer)WS_RESOURCE_XID (window->drawable), window); - - return window; -} - -MetaCompWindow * -meta_comp_window_lookup (Window xid) -{ - MetaCompWindow *window; - - ensure_hash_table (); - - window = g_hash_table_lookup (windows_by_xid, (gpointer)xid); - return window; } void meta_comp_window_free (MetaCompWindow *window) { - ensure_hash_table (); - - g_hash_table_remove (windows_by_xid, WS_RESOURCE_XID (window->drawable)); g_object_unref (window->drawable); g_object_unref (window->node); g_free (window); @@ -142,8 +112,6 @@ has_type (WsWindow *window, const char *check_type) { gchar *type = types[i]; - g_print ("type: %s\n", type); - if (strcmp (type, check_type) == 0) { result = TRUE; @@ -226,6 +194,5 @@ meta_comp_window_get_node (MetaCompWindow *comp_window) { return comp_window->node; } - #endif diff --git a/src/c-window.h b/src/c-window.h index a2892a869..15375957a 100644 --- a/src/c-window.h +++ b/src/c-window.h @@ -23,7 +23,6 @@ typedef struct _MetaCompWindow MetaCompWindow; MetaCompWindow *meta_comp_window_new (WsDrawable *drawable); CmNode *meta_comp_window_get_node (MetaCompWindow *window); -MetaCompWindow *meta_comp_window_lookup (Window xwindow); void meta_comp_window_free (MetaCompWindow *window); void meta_comp_window_set_size (MetaCompWindow *window, WsRectangle *size); diff --git a/src/compositor.c b/src/compositor.c index 0b52361e6..f0a7b2a55 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -186,7 +186,7 @@ static void process_configure_notify (MetaCompositor *compositor, XConfigureEvent *event) { - MetaScreenInfo *minfo = meta_screen_info_get_by_xwindow (event->window); + MetaCompScreen *minfo = meta_comp_screen_get_by_xwindow (event->window); #if 0 g_print ("minfo: %lx => %p\n", event->window, minfo); @@ -205,8 +205,8 @@ process_configure_notify (MetaCompositor *compositor, return; } - meta_screen_info_restack (minfo, event->window, event->above); - meta_screen_info_set_size (minfo, + meta_comp_screen_restack (minfo, event->window, event->above); + meta_comp_screen_set_size (minfo, event->window, event->x, event->y, event->width, event->height); @@ -292,7 +292,7 @@ process_map (MetaCompositor *compositor, return; } - meta_screen_info_add_window (screen->compositor_data, + meta_comp_screen_add_window (screen->compositor_data, event->window); } @@ -319,7 +319,7 @@ process_unmap (MetaCompositor *compositor, return; } - meta_screen_info_unmap (screen->compositor_data, event->window); + meta_comp_screen_unmap (screen->compositor_data, event->window); } #endif /* HAVE_COMPOSITE_EXTENSIONS */ @@ -434,7 +434,7 @@ process_reparent (MetaCompositor *compositor, } else { - meta_screen_info_raise_window (parent_screen->compositor_data, + meta_comp_screen_raise_window (parent_screen->compositor_data, event->window); } } @@ -519,9 +519,9 @@ meta_compositor_add_window (MetaCompositor *compositor, { #ifdef HAVE_COMPOSITE_EXTENSIONS MetaScreen *screen = meta_screen_for_x_screen (attrs->screen); - MetaScreenInfo *minfo = screen->compositor_data; + MetaCompScreen *minfo = screen->compositor_data; - meta_screen_info_add_window (minfo, xwindow); + meta_comp_screen_add_window (minfo, xwindow); #endif } @@ -530,12 +530,12 @@ meta_compositor_remove_window (MetaCompositor *compositor, Window xwindow) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaScreenInfo *minfo; + MetaCompScreen *minfo; - minfo = meta_screen_info_get_by_xwindow (xwindow); + minfo = meta_comp_screen_get_by_xwindow (xwindow); if (minfo) - meta_screen_info_remove_window (minfo, xwindow); + meta_comp_screen_remove_window (minfo, xwindow); #endif /* HAVE_COMPOSITE_EXTENSIONS */ } @@ -544,16 +544,16 @@ meta_compositor_manage_screen (MetaCompositor *compositor, MetaScreen *screen) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaScreenInfo *info; + MetaCompScreen *info; if (screen->compositor_data) return; - info = meta_screen_info_new (compositor->display, screen); + info = meta_comp_screen_new (compositor->display, screen); screen->compositor_data = info; - meta_screen_info_redirect (info); + meta_comp_screen_redirect (info); #endif } @@ -562,9 +562,9 @@ meta_compositor_unmanage_screen (MetaCompositor *compositor, MetaScreen *screen) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaScreenInfo *info = screen->compositor_data; + MetaCompScreen *info = screen->compositor_data; - meta_screen_info_unredirect (info); + meta_comp_screen_unredirect (info); screen->compositor_data = NULL; #endif } @@ -693,7 +693,7 @@ typedef struct GTimer *timer; MetaCompositor *compositor; - MetaScreenInfo *scr_info; + MetaCompScreen *scr_info; MetaAnimationFinishedFunc finished_func; gpointer finished_data; @@ -739,7 +739,7 @@ set_geometry (MiniInfo *info, gdouble elapsed) g_print ("setting: %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height); - meta_screen_info_set_target_rect (info->scr_info, + meta_comp_screen_set_target_rect (info->scr_info, get_xid (info->window), &rect); } @@ -759,7 +759,7 @@ run_phase_1 (MiniInfo *info, gdouble elapsed) #endif info->phase_1_started = TRUE; - meta_screen_info_get_real_size (info->scr_info, get_xid (info->window), + meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window), &info->current_geometry); #if 0 @@ -810,7 +810,7 @@ run_phase_3 (MiniInfo *info, gdouble elapsed) WsRectangle cur = info->target_geometry; WsRectangle real; - meta_screen_info_get_real_size (info->scr_info, get_xid (info->window), + meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window), &real); g_print ("starting phase 3\n"); @@ -868,7 +868,7 @@ run_phase_5 (MiniInfo *info, gdouble elapsed) set_geometry (info, elapsed); - meta_screen_info_set_alpha (info->scr_info, + meta_comp_screen_set_alpha (info->scr_info, get_xid (info->window), 1 - elapsed); } @@ -940,7 +940,7 @@ typedef struct GTimer * timer; MetaAnimationFinishedFunc func; gpointer data; - MetaScreenInfo * minfo; + MetaCompScreen * minfo; } ExplodeInfo; static gboolean @@ -950,15 +950,15 @@ update_explosion (gpointer data) gdouble elapsed = g_timer_elapsed (info->timer, NULL); gdouble t = elapsed / EXPLODE_TIME; - meta_screen_info_set_explode (info->minfo, get_xid (info->window), transform (t)); + meta_comp_screen_set_explode (info->minfo, get_xid (info->window), transform (t)); if (elapsed > EXPLODE_TIME) { if (info->func) info->func (info->data); - meta_screen_info_hide_window (info->minfo, get_xid (info->window)); - meta_screen_info_set_explode (info->minfo, get_xid (info->window), 0.0); + meta_comp_screen_hide_window (info->minfo, get_xid (info->window)); + meta_comp_screen_set_explode (info->minfo, get_xid (info->window), 0.0); return FALSE; } else @@ -984,7 +984,7 @@ meta_compositor_minimize (MetaCompositor *compositor, info->timer = g_timer_new (); info->func = finished; info->data = data; - info->minfo = meta_screen_info_get_by_xwindow (get_xid (window)); + info->minfo = meta_comp_screen_get_by_xwindow (get_xid (window)); g_idle_add (update_explosion, info); } @@ -1042,9 +1042,9 @@ meta_compositor_set_updates (MetaCompositor *compositor, gboolean updates) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaScreenInfo *info = window->screen->compositor_data; + MetaCompScreen *info = window->screen->compositor_data; - meta_screen_info_set_updates (info, get_xid (window), updates); + meta_comp_screen_set_updates (info, get_xid (window), updates); #endif } @@ -1114,7 +1114,7 @@ static gboolean wobble (gpointer data) { MoveInfo *info = data; - MetaScreenInfo *minfo = info->screen->compositor_data; + MetaCompScreen *minfo = info->screen->compositor_data; double t = g_timer_elapsed (info->timer, NULL); #if 0 @@ -1125,7 +1125,7 @@ wobble (gpointer data) info->window_destroyed) { if (!info->window_destroyed) - meta_screen_info_unset_patch (minfo, get_xid (info->window)); + meta_comp_screen_unset_patch (minfo, get_xid (info->window)); move_infos = g_list_remove (move_infos, info); g_free (info); @@ -1148,7 +1148,7 @@ wobble (gpointer data) info->last_time = t; get_patch_points (info->model, points); - meta_screen_info_set_patch (minfo, + meta_comp_screen_set_patch (minfo, get_xid (info->window), points); diff --git a/src/display.c b/src/display.c index dd43935a6..050d8d67f 100644 --- a/src/display.c +++ b/src/display.c @@ -65,8 +65,6 @@ #endif #include -#define USE_GDK_DISPLAY - #define GRAB_OP_IS_WINDOW_SWITCH(g) \ (g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \ g == META_GRAB_OP_KEYBOARD_TABBING_DOCK || \ @@ -96,10 +94,6 @@ static GSList *all_displays = NULL; static void meta_spew_event (MetaDisplay *display, XEvent *event); -#ifndef USE_GDK_DISPLAY -static void event_queue_callback (XEvent *event, - gpointer data); -#endif static gboolean event_callback (XEvent *event, gpointer data); @@ -232,7 +226,7 @@ disable_compositor (MetaDisplay *display) } gboolean -meta_display_open (const char *name) +meta_display_open (void) { MetaDisplay *display; Display *xdisplay; @@ -341,18 +335,14 @@ meta_display_open (const char *name) }; Atom atoms[G_N_ELEMENTS(atom_names)]; - meta_verbose ("Opening display '%s'\n", XDisplayName (name)); + meta_verbose ("Opening display '%s'\n", XDisplayName (NULL)); -#ifdef USE_GDK_DISPLAY - xdisplay = meta_ui_get_display (name); -#else - xdisplay = XOpenDisplay (name); -#endif + xdisplay = meta_ui_get_display (); if (xdisplay == NULL) { meta_warning (_("Failed to open X Window System display '%s'\n"), - XDisplayName (name)); + XDisplayName (NULL)); return FALSE; } @@ -367,7 +357,7 @@ meta_display_open (const char *name) * probably put in, vs. DisplayString(display) which is * canonicalized by XOpenDisplay() */ - display->name = g_strdup (XDisplayName (name)); + display->name = g_strdup (XDisplayName (NULL)); display->xdisplay = xdisplay; display->error_trap_synced_at_last_pop = TRUE; display->error_traps = 0; @@ -526,18 +516,12 @@ meta_display_open (const char *name) sn_error_trap_pop); #endif -#ifdef USE_GDK_DISPLAY display->events = NULL; /* Get events */ meta_ui_add_event_func (display->xdisplay, event_callback, display); -#else - display->events = meta_event_queue_new (display->xdisplay, - event_queue_callback, - display); -#endif display->window_ids = g_hash_table_new (meta_unsigned_long_hash, meta_unsigned_long_equal); @@ -872,12 +856,10 @@ meta_display_close (MetaDisplay *display) if (display->grab_old_window_stacking) g_list_free (display->grab_old_window_stacking); -#ifdef USE_GDK_DISPLAY /* Stop caring about events */ meta_ui_remove_event_func (display->xdisplay, event_callback, display); -#endif /* Free all screens */ tmp = display->screens; @@ -912,10 +894,6 @@ meta_display_close (MetaDisplay *display) meta_display_free_window_prop_hooks (display); meta_display_free_group_prop_hooks (display); -#ifndef USE_GDK_DISPLAY - meta_event_queue_free (display->events); - XCloseDisplay (display->xdisplay); -#endif g_free (display->name); all_displays = g_slist_remove (all_displays, display); @@ -1058,15 +1036,6 @@ meta_displays_list (void) static gboolean dump_events = TRUE; -#ifndef USE_GDK_DISPLAY -static void -event_queue_callback (XEvent *event, - gpointer data) -{ - event_callback (event, data); -} -#endif - static gboolean grab_op_is_mouse (MetaGrabOp op) { diff --git a/src/display.h b/src/display.h index bda028326..65d9da5e8 100644 --- a/src/display.h +++ b/src/display.h @@ -387,7 +387,7 @@ struct _MetaDisplay (time2) != 0) \ ) -gboolean meta_display_open (const char *name); +gboolean meta_display_open (void); void meta_display_close (MetaDisplay *display); MetaScreen* meta_display_screen_for_root (MetaDisplay *display, Window xroot); diff --git a/src/main.c b/src/main.c index 03feb4cfe..ab4bc8d7b 100644 --- a/src/main.c +++ b/src/main.c @@ -472,7 +472,7 @@ main (int argc, char **argv) if (meta_args.client_id) g_free (meta_args.client_id); - if (!meta_display_open (NULL)) + if (!meta_display_open ()) meta_exit (META_EXIT_ERROR); { diff --git a/src/ui.c b/src/ui.c index baeb28899..19cbe9cf1 100644 --- a/src/ui.c +++ b/src/ui.c @@ -56,12 +56,9 @@ meta_ui_init (int *argc, char ***argv) } Display* -meta_ui_get_display (const char *name) +meta_ui_get_display (void) { - if (name == NULL) - return gdk_display; - else - return NULL; + return gdk_display; } typedef struct _EventFunc EventFunc; diff --git a/src/ui.h b/src/ui.h index a677482cf..ae0bceb67 100644 --- a/src/ui.h +++ b/src/ui.h @@ -31,8 +31,6 @@ /* This is between GTK_PRIORITY_RESIZE (+10) and GTK_PRIORITY_REDRAW (+20) */ #define META_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 15) -/* lower than GTK_PRIORITY_REDRAW */ -#define META_PRIORITY_COMPOSITE (G_PRIORITY_HIGH_IDLE + 25) typedef struct _MetaUI MetaUI; @@ -42,7 +40,7 @@ typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data); void meta_ui_init (int *argc, char ***argv); -Display* meta_ui_get_display (const char *name); +Display* meta_ui_get_display (void); void meta_ui_add_event_func (Display *xdisplay, MetaEventFunc func,