handle the client having a shape mask, fixes #101806
2003-01-05 Havoc Pennington <hp@pobox.com> * src/frames.c (meta_frames_apply_shapes): handle the client having a shape mask, fixes #101806 * src/core.c (meta_core_get_client_xwindow): new function * src/frame.c, src/frame.h: keep a flag for whether we need to update the frame shape * src/window.c (meta_window_new): select for ShapeNotify * src/display.h, src/display.c: actually query the shape extension, instead of just using it all over the place. * src/prefs.c (update_application_based): don't let people turn on application_based, as it just causes funky bugs. We can reenable the pref when/if it ever does something useful.
This commit is contained in:

committed by
Havoc Pennington

parent
f8b2f6ca5c
commit
6cfcc01334
47
src/frame.c
47
src/frame.c
@ -58,6 +58,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
frame->current_cursor = 0;
|
||||
|
||||
frame->mapped = FALSE;
|
||||
frame->need_reapply_frame_shape = TRUE;
|
||||
|
||||
attrs.event_mask = EVENT_MASK;
|
||||
|
||||
@ -144,7 +145,9 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
frame->rect.height,
|
||||
frame->window->has_shape);
|
||||
frame->need_reapply_frame_shape = FALSE;
|
||||
|
||||
meta_display_ungrab (window->display);
|
||||
}
|
||||
@ -277,6 +280,20 @@ meta_frame_calc_geometry (MetaFrame *frame,
|
||||
*geomp = geom;
|
||||
}
|
||||
|
||||
static void
|
||||
update_shape (MetaFrame *frame)
|
||||
{
|
||||
if (frame->need_reapply_frame_shape)
|
||||
{
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height,
|
||||
frame->window->has_shape);
|
||||
frame->need_reapply_frame_shape = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_sync_to_window (MetaFrame *frame,
|
||||
int resize_gravity,
|
||||
@ -284,8 +301,11 @@ meta_frame_sync_to_window (MetaFrame *frame,
|
||||
gboolean need_resize)
|
||||
{
|
||||
if (!(need_move || need_resize))
|
||||
return;
|
||||
|
||||
{
|
||||
update_shape (frame);
|
||||
return;
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
"Syncing frame geometry %d,%d %dx%d (SE: %d,%d)\n",
|
||||
frame->rect.x, frame->rect.y,
|
||||
@ -301,18 +321,17 @@ meta_frame_sync_to_window (MetaFrame *frame,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
|
||||
/* Done before the window resize, because doing it before means
|
||||
* part of the window being resized becomes unshaped, which may
|
||||
* be sort of hard to see with bg = None. If we did it after
|
||||
* window resize, part of the window being resized would become
|
||||
* shaped, which might be more visible.
|
||||
*/
|
||||
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
/* we need new shape if we're resized */
|
||||
frame->need_reapply_frame_shape = TRUE;
|
||||
}
|
||||
|
||||
/* Done before the window resize, because doing it before means
|
||||
* part of the window being resized becomes unshaped, which may
|
||||
* be sort of hard to see with bg = None. If we did it after
|
||||
* window resize, part of the window being resized would become
|
||||
* shaped, which might be more visible.
|
||||
*/
|
||||
update_shape (frame);
|
||||
|
||||
if (need_move && need_resize)
|
||||
XMoveResizeWindow (frame->window->display->xdisplay,
|
||||
|
Reference in New Issue
Block a user