New function

Wed May 24 16:37:11 2006  Søren Sandmann  <sandmann@redhat.com>

        * src/c-window.c (private_metacity_window): New function

        * src/c-window.c (meta_comp_window_refresh_attrs): Map metacity's
        own windows directly.
This commit is contained in:
Søren Sandmann 2006-05-24 20:38:56 +00:00 committed by Søren Sandmann Pedersen
parent ca3236f76c
commit 7535f0f58a
4 changed files with 34 additions and 16 deletions

View File

@ -1,3 +1,14 @@
Wed May 24 16:37:11 2006 Søren Sandmann <sandmann@redhat.com>
* src/c-window.c (private_metacity_window): New function
* src/c-window.c (meta_comp_window_refresh_attrs): Map metacity's
own windows directly.
Wed May 24 16:35:54 2006 Søren Sandmann <sandmann@redhat.com>
* src/c-window.c (private_metacity_window):
Wed May 24 14:36:42 2006 Søren Sandmann <sandmann@redhat.com>
* src/c-window.c (meta_comp_window_{freeze,thaw}_stack: Add a

View File

@ -537,7 +537,7 @@ meta_comp_screen_add_window (MetaCompScreen *info,
goto out;
}
comp_window = meta_comp_window_new (info->meta_screen->display, drawable);
comp_window = meta_comp_window_new (info->meta_screen, drawable);
g_hash_table_insert (info->windows_by_xid, (gpointer)WS_RESOURCE_XID (drawable), comp_window);

View File

@ -33,10 +33,12 @@
#include "effects.h"
#include "c-window.h"
#include "window.h"
#include "frame.h"
struct _MetaCompWindow
{
MetaDisplay *display;
MetaScreen *screen;
WsDrawable *drawable;
WsPixmap *pixmap;
CmNode *node;
@ -197,16 +199,18 @@ meta_comp_window_hide (MetaCompWindow *comp_window)
}
MetaCompWindow *
meta_comp_window_new (MetaDisplay *display,
meta_comp_window_new (MetaScreen *screen,
WsDrawable *drawable)
{
MetaDisplay *display = screen->display;
MetaCompWindow *window;
WsRectangle geometry;
ws_drawable_query_geometry (drawable, &geometry);
window = g_new0 (MetaCompWindow, 1);
window->screen = screen;
window->display = display;
window->drawable = g_object_ref (drawable);
window->node = CM_NODE (cm_drawable_node_new (drawable, &geometry));
@ -370,6 +374,17 @@ find_client_window (MetaCompWindow *comp_window)
}
}
static gboolean
private_metacity_window (MetaCompWindow *comp_window)
{
/* Returns TRUE if this is a private metacity window
* such as a tooltip or a menu
*/
XID xid = WS_RESOURCE_XID (comp_window->drawable);
return meta_ui_window_is_widget (comp_window->screen->ui, xid);
}
static gboolean
frameless_managed (MetaCompWindow *comp_window)
{
@ -377,9 +392,8 @@ frameless_managed (MetaCompWindow *comp_window)
* sync requests messages. FIXME: at some point need to find out
* what's going on
*/
MetaWindow *mw = find_meta_window (comp_window);
return mw && !mw->frame;
}
@ -497,19 +511,12 @@ meta_comp_window_refresh_attrs (MetaCompWindow *comp_window)
* sync counter stuff. FIXME: this should be figured out at
* some point.
*/
if (frameless_managed (comp_window) || !send_sync_request (comp_window))
if (frameless_managed (comp_window) ||
private_metacity_window (comp_window) ||
!send_sync_request (comp_window))
{
#if 0
g_print ("directly showing %p\n", comp_window);
#endif
meta_comp_window_show (comp_window);
}
else
{
#if 0
g_print ("for %p waiting for alarm\n", comp_window);
#endif
}
}
}
else

View File

@ -26,7 +26,7 @@
typedef struct _MetaCompWindow MetaCompWindow;
MetaCompWindow *meta_comp_window_new (MetaDisplay *display,
MetaCompWindow *meta_comp_window_new (MetaScreen *screen,
WsDrawable *drawable);
CmNode *meta_comp_window_get_node (MetaCompWindow *window);
gboolean meta_comp_window_free (MetaCompWindow *window);