mirror of
https://github.com/brl/mutter.git
synced 2025-07-23 18:11:23 +00:00
frames: Remove all other uses of meta_core_get
RIP.
This commit is contained in:
@@ -62,78 +62,6 @@ get_window (Display *xdisplay,
|
||||
return window;
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_get (Display *xdisplay,
|
||||
Window xwindow,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
MetaCoreGetType request;
|
||||
|
||||
MetaDisplay *display = meta_display_for_x_display (xdisplay);
|
||||
MetaWindow *window = meta_display_lookup_x_window (display, xwindow);
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||
MetaWindowX11Private *priv = window_x11->priv;
|
||||
|
||||
va_start (args, xwindow);
|
||||
|
||||
request = va_arg (args, MetaCoreGetType);
|
||||
|
||||
/* Now, we special-case the first request slightly. Mostly, requests
|
||||
* for information on windows which have no frame are errors.
|
||||
* But sometimes we may want to know *whether* a window has a frame.
|
||||
* In this case, pass the key META_CORE_WINDOW_HAS_FRAME
|
||||
* as the *first* request, with a pointer to a boolean; if the window
|
||||
* has no frame, this will be set to False and meta_core_get will
|
||||
* exit immediately (so the values of any other requests will be
|
||||
* undefined). Otherwise it will be set to True and meta_core_get will
|
||||
* continue happily on its way.
|
||||
*/
|
||||
|
||||
if (request != META_CORE_WINDOW_HAS_FRAME &&
|
||||
(window == NULL || window->frame == NULL))
|
||||
{
|
||||
meta_bug ("No such frame window 0x%lx!\n", xwindow);
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (request != META_CORE_GET_END)
|
||||
{
|
||||
gpointer answer = va_arg (args, gpointer);
|
||||
|
||||
switch (request)
|
||||
{
|
||||
case META_CORE_WINDOW_HAS_FRAME:
|
||||
*((gboolean*)answer) = window != NULL && window->frame != NULL;
|
||||
if (!*((gboolean*)answer)) goto out; /* see above */
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_WIDTH:
|
||||
*((gint*)answer) = priv->client_rect.width;
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_HEIGHT:
|
||||
*((gint*)answer) = priv->client_rect.height;
|
||||
break;
|
||||
case META_CORE_GET_MINI_ICON:
|
||||
*((cairo_surface_t**)answer) = window->mini_icon;
|
||||
break;
|
||||
case META_CORE_GET_FRAME_RECT:
|
||||
meta_window_get_frame_rect (window, ((MetaRectangle*)answer));
|
||||
break;
|
||||
case META_CORE_GET_THEME_VARIANT:
|
||||
*((char**)answer) = window->gtk_theme_variant;
|
||||
break;
|
||||
|
||||
default:
|
||||
meta_warning("Unknown window information request: %d\n", request);
|
||||
}
|
||||
|
||||
request = va_arg (args, MetaCoreGetType);
|
||||
}
|
||||
|
||||
out:
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_queue_frame_resize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
|
Reference in New Issue
Block a user