Remove MetaImageWindow
The code isn't used anymore. https://bugzilla.gnome.org/show_bug.cgi?id=630203
This commit is contained in:
parent
741d2b761a
commit
a3c6486e52
@ -33,8 +33,6 @@
|
||||
|
||||
typedef struct _MetaUI MetaUI;
|
||||
|
||||
typedef struct _MetaImageWindow MetaImageWindow;
|
||||
|
||||
typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
|
||||
|
||||
typedef enum
|
||||
@ -132,18 +130,6 @@ void meta_ui_window_menu_popup (MetaWindowMenu *menu,
|
||||
void meta_ui_window_menu_free (MetaWindowMenu *menu);
|
||||
|
||||
|
||||
MetaImageWindow* meta_image_window_new (Display *xdisplay,
|
||||
int screen_number,
|
||||
int max_width,
|
||||
int max_height);
|
||||
void meta_image_window_free (MetaImageWindow *iw);
|
||||
void meta_image_window_set_showing (MetaImageWindow *iw,
|
||||
gboolean showing);
|
||||
void meta_image_window_set (MetaImageWindow *iw,
|
||||
GdkPixbuf *pixbuf,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
/* FIXME these lack a display arg */
|
||||
GdkPixbuf* meta_gdk_pixbuf_get_from_window (GdkPixbuf *dest,
|
||||
Window xwindow,
|
||||
|
91
src/ui/ui.c
91
src/ui/ui.c
@ -355,97 +355,6 @@ meta_ui_window_menu_free (MetaWindowMenu *menu)
|
||||
meta_window_menu_free (menu);
|
||||
}
|
||||
|
||||
struct _MetaImageWindow
|
||||
{
|
||||
GtkWidget *window;
|
||||
GdkPixmap *pixmap;
|
||||
};
|
||||
|
||||
MetaImageWindow*
|
||||
meta_image_window_new (Display *xdisplay,
|
||||
int screen_number,
|
||||
int max_width,
|
||||
int max_height)
|
||||
{
|
||||
MetaImageWindow *iw;
|
||||
GdkDisplay *gdisplay;
|
||||
GdkScreen *gscreen;
|
||||
|
||||
iw = g_new (MetaImageWindow, 1);
|
||||
iw->window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
|
||||
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
|
||||
gscreen = gdk_display_get_screen (gdisplay, screen_number);
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (iw->window), gscreen);
|
||||
|
||||
gtk_widget_realize (iw->window);
|
||||
iw->pixmap = gdk_pixmap_new (gtk_widget_get_window (iw->window),
|
||||
max_width, max_height,
|
||||
-1);
|
||||
|
||||
gtk_widget_set_size_request (iw->window, 1, 1);
|
||||
gtk_widget_set_double_buffered (iw->window, FALSE);
|
||||
gtk_widget_set_app_paintable (iw->window, TRUE);
|
||||
|
||||
return iw;
|
||||
}
|
||||
|
||||
void
|
||||
meta_image_window_free (MetaImageWindow *iw)
|
||||
{
|
||||
gtk_widget_destroy (iw->window);
|
||||
g_object_unref (G_OBJECT (iw->pixmap));
|
||||
g_free (iw);
|
||||
}
|
||||
|
||||
void
|
||||
meta_image_window_set_showing (MetaImageWindow *iw,
|
||||
gboolean showing)
|
||||
{
|
||||
if (showing)
|
||||
gtk_widget_show_all (iw->window);
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (iw->window);
|
||||
meta_core_increment_event_serial (
|
||||
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_image_window_set (MetaImageWindow *iw,
|
||||
GdkPixbuf *pixbuf,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GdkWindow *window;
|
||||
cairo_t *cr;
|
||||
|
||||
/* We use a back pixmap to avoid having to handle exposes, because
|
||||
* it's really too slow for large clients being minimized, etc.
|
||||
* and this way flicker is genuinely zero.
|
||||
*/
|
||||
|
||||
cr = gdk_cairo_create (iw->pixmap);
|
||||
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
|
||||
window = gtk_widget_get_window (iw->window);
|
||||
|
||||
gdk_window_set_back_pixmap (window,
|
||||
iw->pixmap,
|
||||
FALSE);
|
||||
|
||||
gdk_window_move_resize (window,
|
||||
x, y,
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf));
|
||||
|
||||
gdk_window_clear (window);
|
||||
}
|
||||
|
||||
static GdkColormap*
|
||||
get_cmap (GdkPixmap *pixmap)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user