Delete unused META_PRIORITY_COMPOSITE

Thu May  4 13:30:04 2006  Søren Sandmann  <sandmann@redhat.com>

	* 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).
This commit is contained in:
Søren Sandmann 2006-05-04 17:32:26 +00:00 committed by Søren Sandmann Pedersen
parent 411fd3db44
commit addc04f463
11 changed files with 196 additions and 206 deletions

View File

@ -1,3 +1,23 @@
Thu May 4 13:30:04 2006 Søren Sandmann <sandmann@redhat.com>
* 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 <sandmann@redhat.com> Tue May 2 17:12:54 2006 Søren Sandmann <sandmann@redhat.com>
* src/c-window.[ch]: New files * src/c-window.[ch]: New files

View File

@ -33,7 +33,7 @@
#include "c-screen.h" #include "c-screen.h"
#include "c-window.h" #include "c-window.h"
struct MetaScreenInfo struct MetaCompScreen
{ {
WsDisplay *display; WsDisplay *display;
CmStacker *stacker; CmStacker *stacker;
@ -49,8 +49,21 @@ struct MetaScreenInfo
int idle_id; int idle_id;
WsWindow *selection_window; 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 #if 0
static void static void
update_frame_counter (void) update_frame_counter (void)
@ -99,7 +112,7 @@ dump_stacking_order (GList *nodes)
static gboolean static gboolean
repaint (gpointer data) repaint (gpointer data)
{ {
MetaScreenInfo *info = data; MetaCompScreen *info = data;
CmState *state; CmState *state;
#if 0 #if 0
g_print ("repaint\n"); g_print ("repaint\n");
@ -148,17 +161,17 @@ repaint (gpointer data)
} }
static MetaCompWindow * static MetaCompWindow *
find_comp_window (MetaScreenInfo *info, find_comp_window (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
return meta_comp_window_lookup (xwindow); return meta_comp_window_lookup (info, xwindow);
} }
static CmNode * static CmNode *
find_node (MetaScreenInfo *info, find_node (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
MetaCompWindow *window = meta_comp_window_lookup (xwindow); MetaCompWindow *window = meta_comp_window_lookup (info, xwindow);
if (window) if (window)
return meta_comp_window_get_node (window); return meta_comp_window_get_node (window);
@ -168,14 +181,14 @@ find_node (MetaScreenInfo *info,
static GList *all_screen_infos; static GList *all_screen_infos;
MetaScreenInfo * MetaCompScreen *
meta_screen_info_get_by_xwindow (Window xwindow) meta_comp_screen_get_by_xwindow (Window xwindow)
{ {
GList *list; GList *list;
for (list = all_screen_infos; list != NULL; list = list->next) for (list = all_screen_infos; list != NULL; list = list->next)
{ {
MetaScreenInfo *info = list->data; MetaCompScreen *info = list->data;
if (find_node (info, xwindow)) if (find_node (info, xwindow))
return info; return info;
@ -184,17 +197,18 @@ meta_screen_info_get_by_xwindow (Window xwindow)
return NULL; return NULL;
} }
MetaScreenInfo * MetaCompScreen *
meta_screen_info_new (WsDisplay *display, meta_comp_screen_new (WsDisplay *display,
MetaScreen *screen) 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 ( scr_info->screen = ws_display_get_screen_from_number (
display, screen->number); display, screen->number);
scr_info->root_window = ws_screen_get_root_window (scr_info->screen); scr_info->root_window = ws_screen_get_root_window (scr_info->screen);
scr_info->display = display; scr_info->display = display;
scr_info->meta_screen = screen; 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); all_screen_infos = g_list_prepend (all_screen_infos, scr_info);
@ -202,7 +216,7 @@ meta_screen_info_new (WsDisplay *display,
} }
static char * static char *
make_selection_name (MetaScreenInfo *info) make_selection_name (MetaCompScreen *info)
{ {
char *buffer; char *buffer;
@ -216,18 +230,18 @@ on_selection_clear (WsWindow *window,
WsSelectionClearEvent *event, WsSelectionClearEvent *event,
gpointer data) gpointer data)
{ {
MetaScreenInfo *info = data; MetaCompScreen *info = data;
char *buffer = make_selection_name (info); char *buffer = make_selection_name (info);
if (strcmp (event->selection, buffer)) if (strcmp (event->selection, buffer))
{ {
/* We lost the selection */ /* We lost the selection */
meta_screen_info_unredirect (info); meta_comp_screen_unredirect (info);
} }
} }
static WsWindow * static WsWindow *
claim_selection (MetaScreenInfo *info) claim_selection (MetaCompScreen *info)
{ {
WsWindow *window = ws_window_new (info->root_window); WsWindow *window = ws_window_new (info->root_window);
char *buffer = make_selection_name (info); char *buffer = make_selection_name (info);
@ -247,16 +261,16 @@ claim_selection (MetaScreenInfo *info)
static void static void
queue_paint (CmNode *node, queue_paint (CmNode *node,
MetaScreenInfo *info) MetaCompScreen *info)
{ {
#if 0 #if 0
g_print ("queueing %s\n", G_OBJECT_TYPE_NAME (node)); g_print ("queueing %s\n", G_OBJECT_TYPE_NAME (node));
#endif #endif
meta_screen_info_queue_paint (info); meta_comp_screen_queue_paint (info);
} }
void void
meta_screen_info_redirect (MetaScreenInfo *info) meta_comp_screen_redirect (MetaCompScreen *info)
{ {
WsWindow *root = ws_screen_get_root_window (info->screen); WsWindow *root = ws_screen_get_root_window (info->screen);
WsRectangle source; WsRectangle source;
@ -329,25 +343,47 @@ meta_screen_info_redirect (MetaScreenInfo *info)
ws_display_sync (info->display); 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 void
meta_screen_info_unredirect (MetaScreenInfo *info) meta_comp_screen_unredirect (MetaCompScreen *info)
{ {
WsScreen *ws_screen = info->screen; WsScreen *ws_screen = info->screen;
WsWindow *root = ws_screen_get_root_window (ws_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_signal_handler_disconnect (info->magnifier, info->repaint_id);
g_object_unref (info->magnifier); g_object_unref (info->magnifier);
ws_window_unredirect_subwindows (root); ws_window_unredirect_subwindows (root);
#if 0
ws_window_unmap (info->gl_window);
#endif
ws_screen_release_gl_window (ws_screen); ws_screen_release_gl_window (ws_screen);
free_all_windows (info);
ws_display_sync (info->display); ws_display_sync (info->display);
/* FIXME: libcm needs a way to guarantee that a window is destroyed, /* FIXME: libcm needs a way to guarantee that a window is destroyed,
@ -357,7 +393,7 @@ meta_screen_info_unredirect (MetaScreenInfo *info)
} }
void void
meta_screen_info_queue_paint (MetaScreenInfo *info) meta_comp_screen_queue_paint (MetaCompScreen *info)
{ {
#if 0 #if 0
g_print ("queuing\n"); g_print ("queuing\n");
@ -367,7 +403,7 @@ meta_screen_info_queue_paint (MetaScreenInfo *info)
} }
void void
meta_screen_info_restack (MetaScreenInfo *info, meta_comp_screen_restack (MetaCompScreen *info,
Window window, Window window,
Window above_this) Window above_this)
{ {
@ -412,7 +448,7 @@ meta_screen_info_restack (MetaScreenInfo *info,
} }
void void
meta_screen_info_raise_window (MetaScreenInfo *info, meta_comp_screen_raise_window (MetaCompScreen *info,
Window window) Window window)
{ {
CmNode *node = find_node (info, window); CmNode *node = find_node (info, window);
@ -422,14 +458,14 @@ meta_screen_info_raise_window (MetaScreenInfo *info,
} }
void void
meta_screen_info_set_size (MetaScreenInfo *info, meta_comp_screen_set_size (MetaCompScreen *info,
Window xwindow, Window xwindow,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height) gint height)
{ {
MetaCompWindow *comp_window = meta_comp_window_lookup (xwindow); MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow);
if (comp_window) if (comp_window)
{ {
@ -463,7 +499,7 @@ print_child_titles (WsWindow *window)
} }
void void
meta_screen_info_add_window (MetaScreenInfo *info, meta_comp_screen_add_window (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
WsDrawable *drawable; WsDrawable *drawable;
@ -471,7 +507,7 @@ meta_screen_info_add_window (MetaScreenInfo *info,
ws_display_begin_error_trap (info->display); 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) if (comp_window)
goto out; goto out;
@ -492,6 +528,8 @@ meta_screen_info_add_window (MetaScreenInfo *info,
comp_window = meta_comp_window_new (drawable); 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)); cm_stacker_add_child (info->stacker, meta_comp_window_get_node (comp_window));
out: out:
@ -509,10 +547,10 @@ meta_screen_info_add_window (MetaScreenInfo *info,
void void
meta_screen_info_remove_window (MetaScreenInfo *info, meta_comp_screen_remove_window (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
MetaCompWindow *comp_window = meta_comp_window_lookup (xwindow); MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow);
if (comp_window) if (comp_window)
{ {
@ -520,22 +558,24 @@ meta_screen_info_remove_window (MetaScreenInfo *info,
cm_stacker_remove_child (info->stacker, node); cm_stacker_remove_child (info->stacker, node);
meta_comp_window_free (comp_window); meta_comp_window_free (comp_window);
g_hash_table_remove (info->windows_by_xid, (gpointer)xwindow);
} }
} }
void void
meta_screen_info_set_updates (MetaScreenInfo *info, meta_comp_screen_set_updates (MetaCompScreen *info,
Window xwindow, Window xwindow,
gboolean updates) 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); meta_comp_window_set_updates (comp_window, updates);
} }
void void
meta_screen_info_set_patch (MetaScreenInfo *info, meta_comp_screen_set_patch (MetaCompScreen *info,
Window xwindow, Window xwindow,
CmPoint points[4][4]) CmPoint points[4][4])
{ {
@ -546,7 +586,7 @@ meta_screen_info_set_patch (MetaScreenInfo *info,
} }
void void
meta_screen_info_unset_patch (MetaScreenInfo *info, meta_comp_screen_unset_patch (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
@ -556,7 +596,7 @@ meta_screen_info_unset_patch (MetaScreenInfo *info,
} }
void void
meta_screen_info_set_alpha (MetaScreenInfo *info, meta_comp_screen_set_alpha (MetaCompScreen *info,
Window xwindow, Window xwindow,
gdouble alpha) gdouble alpha)
{ {
@ -568,7 +608,7 @@ meta_screen_info_set_alpha (MetaScreenInfo *info,
} }
void void
meta_screen_info_get_real_size (MetaScreenInfo *info, meta_comp_screen_get_real_size (MetaCompScreen *info,
Window xwindow, Window xwindow,
WsRectangle *size) WsRectangle *size)
{ {
@ -581,7 +621,7 @@ meta_screen_info_get_real_size (MetaScreenInfo *info,
} }
void void
meta_screen_info_unmap (MetaScreenInfo *info, meta_comp_screen_unmap (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
@ -595,7 +635,7 @@ meta_screen_info_unmap (MetaScreenInfo *info,
} }
void void
meta_screen_info_set_target_rect (MetaScreenInfo *info, meta_comp_screen_set_target_rect (MetaCompScreen *info,
Window xwindow, Window xwindow,
WsRectangle *rect) WsRectangle *rect)
{ {
@ -606,7 +646,7 @@ meta_screen_info_set_target_rect (MetaScreenInfo *info,
} }
void void
meta_screen_info_set_explode (MetaScreenInfo *info, meta_comp_screen_set_explode (MetaCompScreen *info,
Window xwindow, Window xwindow,
gdouble level) gdouble level)
{ {
@ -623,7 +663,7 @@ meta_screen_info_set_explode (MetaScreenInfo *info,
} }
void void
meta_screen_info_hide_window (MetaScreenInfo *info, meta_comp_screen_hide_window (MetaCompScreen *info,
Window xwindow) Window xwindow)
{ {
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow)); CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));

View File

@ -1,51 +1,51 @@
#include "screen.h" #include "screen.h"
typedef struct MetaScreenInfo MetaScreenInfo; typedef struct MetaCompScreen MetaCompScreen;
MetaScreenInfo *meta_screen_info_new (WsDisplay *display, MetaCompScreen *meta_comp_screen_new (WsDisplay *display,
MetaScreen *screen); MetaScreen *screen);
MetaScreenInfo *meta_screen_info_get_by_xwindow (Window xwindow); MetaCompScreen *meta_comp_screen_get_by_xwindow (Window xwindow);
void meta_screen_info_destroy (MetaScreenInfo *scr_info); void meta_comp_screen_destroy (MetaCompScreen *scr_info);
void meta_screen_info_redirect (MetaScreenInfo *info); void meta_comp_screen_redirect (MetaCompScreen *info);
void meta_screen_info_unredirect (MetaScreenInfo *info); void meta_comp_screen_unredirect (MetaCompScreen *info);
void meta_screen_info_add_window (MetaScreenInfo *scr_info, void meta_comp_screen_add_window (MetaCompScreen *scr_info,
Window xwindow); Window xwindow);
void meta_screen_info_remove_window (MetaScreenInfo *scr_info, void meta_comp_screen_remove_window (MetaCompScreen *scr_info,
Window xwindow); Window xwindow);
void meta_screen_info_restack (MetaScreenInfo *scr_info, void meta_comp_screen_restack (MetaCompScreen *scr_info,
Window window, Window window,
Window above_this); Window above_this);
void meta_screen_info_set_size (MetaScreenInfo *info, void meta_comp_screen_set_size (MetaCompScreen *info,
Window window, Window window,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
void meta_screen_info_raise_window (MetaScreenInfo *scr_info, void meta_comp_screen_raise_window (MetaCompScreen *scr_info,
Window window); Window window);
void meta_screen_info_queue_paint (MetaScreenInfo *info); void meta_comp_screen_queue_paint (MetaCompScreen *info);
void meta_screen_info_set_updates (MetaScreenInfo *info, void meta_comp_screen_set_updates (MetaCompScreen *info,
Window xwindow, Window xwindow,
gboolean updates); gboolean updates);
void meta_screen_info_set_patch (MetaScreenInfo *info, void meta_comp_screen_set_patch (MetaCompScreen *info,
Window xwindow, Window xwindow,
CmPoint points[4][4]); CmPoint points[4][4]);
void meta_screen_info_unset_patch (MetaScreenInfo *info, void meta_comp_screen_unset_patch (MetaCompScreen *info,
Window xwindow); Window xwindow);
void meta_screen_info_set_alpha (MetaScreenInfo *info, void meta_comp_screen_set_alpha (MetaCompScreen *info,
Window xwindow, Window xwindow,
gdouble alpha); gdouble alpha);
void meta_screen_info_get_real_size (MetaScreenInfo *info, void meta_comp_screen_get_real_size (MetaCompScreen *info,
Window xwindow, Window xwindow,
WsRectangle *size); WsRectangle *size);
void meta_screen_info_set_target_rect (MetaScreenInfo *info, void meta_comp_screen_set_target_rect (MetaCompScreen *info,
Window xwindow, Window xwindow,
WsRectangle *rect); WsRectangle *rect);
void meta_comp_screen_set_explode (MetaCompScreen *info,
void meta_screen_info_set_explode (MetaScreenInfo *info,
Window xwindow, Window xwindow,
gdouble level); gdouble level);
void meta_screen_info_hide_window (MetaScreenInfo *info, void meta_comp_screen_hide_window (MetaCompScreen *info,
Window xwindow); Window xwindow);
void meta_screen_info_unmap (MetaScreenInfo *info, void meta_comp_screen_unmap (MetaCompScreen *info,
Window xwindow); Window xwindow);

View File

@ -30,8 +30,7 @@
#include <string.h> #include <string.h>
#include "c-window.h" #include "c-window.h"
#include "window.h"
static GHashTable *windows_by_xid;
struct _MetaCompWindow struct _MetaCompWindow
{ {
@ -42,16 +41,6 @@ struct _MetaCompWindow
WsRectangle size; 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 * MetaCompWindow *
meta_comp_window_new (WsDrawable *drawable) meta_comp_window_new (WsDrawable *drawable)
{ {
@ -66,31 +55,12 @@ meta_comp_window_new (WsDrawable *drawable)
window->node = CM_NODE (cm_drawable_node_new (drawable, &geometry)); window->node = CM_NODE (cm_drawable_node_new (drawable, &geometry));
window->updates = TRUE; 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; return window;
} }
void void
meta_comp_window_free (MetaCompWindow *window) 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->drawable);
g_object_unref (window->node); g_object_unref (window->node);
g_free (window); g_free (window);
@ -142,8 +112,6 @@ has_type (WsWindow *window, const char *check_type)
{ {
gchar *type = types[i]; gchar *type = types[i];
g_print ("type: %s\n", type);
if (strcmp (type, check_type) == 0) if (strcmp (type, check_type) == 0)
{ {
result = TRUE; result = TRUE;
@ -227,5 +195,4 @@ meta_comp_window_get_node (MetaCompWindow *comp_window)
return comp_window->node; return comp_window->node;
} }
#endif #endif

View File

@ -23,7 +23,6 @@ typedef struct _MetaCompWindow MetaCompWindow;
MetaCompWindow *meta_comp_window_new (WsDrawable *drawable); MetaCompWindow *meta_comp_window_new (WsDrawable *drawable);
CmNode *meta_comp_window_get_node (MetaCompWindow *window); 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_free (MetaCompWindow *window);
void meta_comp_window_set_size (MetaCompWindow *window, void meta_comp_window_set_size (MetaCompWindow *window,
WsRectangle *size); WsRectangle *size);

View File

@ -186,7 +186,7 @@ static void
process_configure_notify (MetaCompositor *compositor, process_configure_notify (MetaCompositor *compositor,
XConfigureEvent *event) XConfigureEvent *event)
{ {
MetaScreenInfo *minfo = meta_screen_info_get_by_xwindow (event->window); MetaCompScreen *minfo = meta_comp_screen_get_by_xwindow (event->window);
#if 0 #if 0
g_print ("minfo: %lx => %p\n", event->window, minfo); g_print ("minfo: %lx => %p\n", event->window, minfo);
@ -205,8 +205,8 @@ process_configure_notify (MetaCompositor *compositor,
return; return;
} }
meta_screen_info_restack (minfo, event->window, event->above); meta_comp_screen_restack (minfo, event->window, event->above);
meta_screen_info_set_size (minfo, meta_comp_screen_set_size (minfo,
event->window, event->window,
event->x, event->y, event->x, event->y,
event->width, event->height); event->width, event->height);
@ -292,7 +292,7 @@ process_map (MetaCompositor *compositor,
return; return;
} }
meta_screen_info_add_window (screen->compositor_data, meta_comp_screen_add_window (screen->compositor_data,
event->window); event->window);
} }
@ -319,7 +319,7 @@ process_unmap (MetaCompositor *compositor,
return; return;
} }
meta_screen_info_unmap (screen->compositor_data, event->window); meta_comp_screen_unmap (screen->compositor_data, event->window);
} }
#endif /* HAVE_COMPOSITE_EXTENSIONS */ #endif /* HAVE_COMPOSITE_EXTENSIONS */
@ -434,7 +434,7 @@ process_reparent (MetaCompositor *compositor,
} }
else else
{ {
meta_screen_info_raise_window (parent_screen->compositor_data, meta_comp_screen_raise_window (parent_screen->compositor_data,
event->window); event->window);
} }
} }
@ -519,9 +519,9 @@ meta_compositor_add_window (MetaCompositor *compositor,
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaScreen *screen = meta_screen_for_x_screen (attrs->screen); 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 #endif
} }
@ -530,12 +530,12 @@ meta_compositor_remove_window (MetaCompositor *compositor,
Window xwindow) Window xwindow)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #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) if (minfo)
meta_screen_info_remove_window (minfo, xwindow); meta_comp_screen_remove_window (minfo, xwindow);
#endif /* HAVE_COMPOSITE_EXTENSIONS */ #endif /* HAVE_COMPOSITE_EXTENSIONS */
} }
@ -544,16 +544,16 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
MetaScreen *screen) MetaScreen *screen)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaScreenInfo *info; MetaCompScreen *info;
if (screen->compositor_data) if (screen->compositor_data)
return; return;
info = meta_screen_info_new (compositor->display, screen); info = meta_comp_screen_new (compositor->display, screen);
screen->compositor_data = info; screen->compositor_data = info;
meta_screen_info_redirect (info); meta_comp_screen_redirect (info);
#endif #endif
} }
@ -562,9 +562,9 @@ meta_compositor_unmanage_screen (MetaCompositor *compositor,
MetaScreen *screen) MetaScreen *screen)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #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; screen->compositor_data = NULL;
#endif #endif
} }
@ -693,7 +693,7 @@ typedef struct
GTimer *timer; GTimer *timer;
MetaCompositor *compositor; MetaCompositor *compositor;
MetaScreenInfo *scr_info; MetaCompScreen *scr_info;
MetaAnimationFinishedFunc finished_func; MetaAnimationFinishedFunc finished_func;
gpointer finished_data; 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); 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); get_xid (info->window), &rect);
} }
@ -759,7 +759,7 @@ run_phase_1 (MiniInfo *info, gdouble elapsed)
#endif #endif
info->phase_1_started = TRUE; 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); &info->current_geometry);
#if 0 #if 0
@ -810,7 +810,7 @@ run_phase_3 (MiniInfo *info, gdouble elapsed)
WsRectangle cur = info->target_geometry; WsRectangle cur = info->target_geometry;
WsRectangle real; 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); &real);
g_print ("starting phase 3\n"); g_print ("starting phase 3\n");
@ -868,7 +868,7 @@ run_phase_5 (MiniInfo *info, gdouble elapsed)
set_geometry (info, 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); get_xid (info->window), 1 - elapsed);
} }
@ -940,7 +940,7 @@ typedef struct
GTimer * timer; GTimer * timer;
MetaAnimationFinishedFunc func; MetaAnimationFinishedFunc func;
gpointer data; gpointer data;
MetaScreenInfo * minfo; MetaCompScreen * minfo;
} ExplodeInfo; } ExplodeInfo;
static gboolean static gboolean
@ -950,15 +950,15 @@ update_explosion (gpointer data)
gdouble elapsed = g_timer_elapsed (info->timer, NULL); gdouble elapsed = g_timer_elapsed (info->timer, NULL);
gdouble t = elapsed / EXPLODE_TIME; 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 (elapsed > EXPLODE_TIME)
{ {
if (info->func) if (info->func)
info->func (info->data); info->func (info->data);
meta_screen_info_hide_window (info->minfo, get_xid (info->window)); meta_comp_screen_hide_window (info->minfo, get_xid (info->window));
meta_screen_info_set_explode (info->minfo, get_xid (info->window), 0.0); meta_comp_screen_set_explode (info->minfo, get_xid (info->window), 0.0);
return FALSE; return FALSE;
} }
else else
@ -984,7 +984,7 @@ meta_compositor_minimize (MetaCompositor *compositor,
info->timer = g_timer_new (); info->timer = g_timer_new ();
info->func = finished; info->func = finished;
info->data = data; 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); g_idle_add (update_explosion, info);
} }
@ -1042,9 +1042,9 @@ meta_compositor_set_updates (MetaCompositor *compositor,
gboolean updates) gboolean updates)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #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 #endif
} }
@ -1114,7 +1114,7 @@ static gboolean
wobble (gpointer data) wobble (gpointer data)
{ {
MoveInfo *info = data; MoveInfo *info = data;
MetaScreenInfo *minfo = info->screen->compositor_data; MetaCompScreen *minfo = info->screen->compositor_data;
double t = g_timer_elapsed (info->timer, NULL); double t = g_timer_elapsed (info->timer, NULL);
#if 0 #if 0
@ -1125,7 +1125,7 @@ wobble (gpointer data)
info->window_destroyed) info->window_destroyed)
{ {
if (!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); move_infos = g_list_remove (move_infos, info);
g_free (info); g_free (info);
@ -1148,7 +1148,7 @@ wobble (gpointer data)
info->last_time = t; info->last_time = t;
get_patch_points (info->model, points); get_patch_points (info->model, points);
meta_screen_info_set_patch (minfo, meta_comp_screen_set_patch (minfo,
get_xid (info->window), get_xid (info->window),
points); points);

View File

@ -65,8 +65,6 @@
#endif #endif
#include <string.h> #include <string.h>
#define USE_GDK_DISPLAY
#define GRAB_OP_IS_WINDOW_SWITCH(g) \ #define GRAB_OP_IS_WINDOW_SWITCH(g) \
(g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \ (g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \
g == META_GRAB_OP_KEYBOARD_TABBING_DOCK || \ g == META_GRAB_OP_KEYBOARD_TABBING_DOCK || \
@ -96,10 +94,6 @@ static GSList *all_displays = NULL;
static void meta_spew_event (MetaDisplay *display, static void meta_spew_event (MetaDisplay *display,
XEvent *event); XEvent *event);
#ifndef USE_GDK_DISPLAY
static void event_queue_callback (XEvent *event,
gpointer data);
#endif
static gboolean event_callback (XEvent *event, static gboolean event_callback (XEvent *event,
gpointer data); gpointer data);
@ -232,7 +226,7 @@ disable_compositor (MetaDisplay *display)
} }
gboolean gboolean
meta_display_open (const char *name) meta_display_open (void)
{ {
MetaDisplay *display; MetaDisplay *display;
Display *xdisplay; Display *xdisplay;
@ -341,18 +335,14 @@ meta_display_open (const char *name)
}; };
Atom atoms[G_N_ELEMENTS(atom_names)]; 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 ();
xdisplay = meta_ui_get_display (name);
#else
xdisplay = XOpenDisplay (name);
#endif
if (xdisplay == NULL) if (xdisplay == NULL)
{ {
meta_warning (_("Failed to open X Window System display '%s'\n"), meta_warning (_("Failed to open X Window System display '%s'\n"),
XDisplayName (name)); XDisplayName (NULL));
return FALSE; return FALSE;
} }
@ -367,7 +357,7 @@ meta_display_open (const char *name)
* probably put in, vs. DisplayString(display) which is * probably put in, vs. DisplayString(display) which is
* canonicalized by XOpenDisplay() * canonicalized by XOpenDisplay()
*/ */
display->name = g_strdup (XDisplayName (name)); display->name = g_strdup (XDisplayName (NULL));
display->xdisplay = xdisplay; display->xdisplay = xdisplay;
display->error_trap_synced_at_last_pop = TRUE; display->error_trap_synced_at_last_pop = TRUE;
display->error_traps = 0; display->error_traps = 0;
@ -526,18 +516,12 @@ meta_display_open (const char *name)
sn_error_trap_pop); sn_error_trap_pop);
#endif #endif
#ifdef USE_GDK_DISPLAY
display->events = NULL; display->events = NULL;
/* Get events */ /* Get events */
meta_ui_add_event_func (display->xdisplay, meta_ui_add_event_func (display->xdisplay,
event_callback, event_callback,
display); 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, display->window_ids = g_hash_table_new (meta_unsigned_long_hash,
meta_unsigned_long_equal); meta_unsigned_long_equal);
@ -872,12 +856,10 @@ meta_display_close (MetaDisplay *display)
if (display->grab_old_window_stacking) if (display->grab_old_window_stacking)
g_list_free (display->grab_old_window_stacking); g_list_free (display->grab_old_window_stacking);
#ifdef USE_GDK_DISPLAY
/* Stop caring about events */ /* Stop caring about events */
meta_ui_remove_event_func (display->xdisplay, meta_ui_remove_event_func (display->xdisplay,
event_callback, event_callback,
display); display);
#endif
/* Free all screens */ /* Free all screens */
tmp = display->screens; tmp = display->screens;
@ -912,10 +894,6 @@ meta_display_close (MetaDisplay *display)
meta_display_free_window_prop_hooks (display); meta_display_free_window_prop_hooks (display);
meta_display_free_group_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); g_free (display->name);
all_displays = g_slist_remove (all_displays, display); all_displays = g_slist_remove (all_displays, display);
@ -1058,15 +1036,6 @@ meta_displays_list (void)
static gboolean dump_events = TRUE; 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 static gboolean
grab_op_is_mouse (MetaGrabOp op) grab_op_is_mouse (MetaGrabOp op)
{ {

View File

@ -387,7 +387,7 @@ struct _MetaDisplay
(time2) != 0) \ (time2) != 0) \
) )
gboolean meta_display_open (const char *name); gboolean meta_display_open (void);
void meta_display_close (MetaDisplay *display); void meta_display_close (MetaDisplay *display);
MetaScreen* meta_display_screen_for_root (MetaDisplay *display, MetaScreen* meta_display_screen_for_root (MetaDisplay *display,
Window xroot); Window xroot);

View File

@ -472,7 +472,7 @@ main (int argc, char **argv)
if (meta_args.client_id) if (meta_args.client_id)
g_free (meta_args.client_id); g_free (meta_args.client_id);
if (!meta_display_open (NULL)) if (!meta_display_open ())
meta_exit (META_EXIT_ERROR); meta_exit (META_EXIT_ERROR);
{ {

View File

@ -56,12 +56,9 @@ meta_ui_init (int *argc, char ***argv)
} }
Display* Display*
meta_ui_get_display (const char *name) meta_ui_get_display (void)
{ {
if (name == NULL)
return gdk_display; return gdk_display;
else
return NULL;
} }
typedef struct _EventFunc EventFunc; typedef struct _EventFunc EventFunc;

View File

@ -31,8 +31,6 @@
/* This is between GTK_PRIORITY_RESIZE (+10) and GTK_PRIORITY_REDRAW (+20) */ /* This is between GTK_PRIORITY_RESIZE (+10) and GTK_PRIORITY_REDRAW (+20) */
#define META_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 15) #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; typedef struct _MetaUI MetaUI;
@ -42,7 +40,7 @@ typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
void meta_ui_init (int *argc, char ***argv); 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, void meta_ui_add_event_func (Display *xdisplay,
MetaEventFunc func, MetaEventFunc func,