diff options
author | Laszlo Boros <[email protected]> | 2013-10-26 14:27:58 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-10-26 14:27:58 +0200 |
commit | 35d540dd3c9269ec39bf3bc10a98b9714963291b (patch) | |
tree | ae76b286839a6d3a6ebe309bdb7884bd35a3698d /src/ui/fixedtip.c | |
parent | 46ba8ca5fc9665c1a4758e56fda6761ac993c62e (diff) | |
download | marco-35d540dd3c9269ec39bf3bc10a98b9714963291b.tar.bz2 marco-35d540dd3c9269ec39bf3bc10a98b9714963291b.tar.xz |
Starting to add GTK3 support
Diffstat (limited to 'src/ui/fixedtip.c')
-rw-r--r-- | src/ui/fixedtip.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c index 707c461f..3d9aea06 100644 --- a/src/ui/fixedtip.c +++ b/src/ui/fixedtip.c @@ -50,6 +50,24 @@ static int screen_right_edge = 0; */ static int screen_bottom_edge = 0; +#if GTK_CHECK_VERSION(3, 0, 0) + +static gboolean +draw_handler (GtkWidget *tooltips, + cairo_t *cr, + gpointer user_data) +{ + gtk_render_background (gtk_widget_get_style_context (tooltips), + cr, + 0, 0, + gtk_widget_get_allocated_width (tooltips), + gtk_widget_get_allocated_height (tooltips)); + + return FALSE; +} + +#else + static gint expose_handler (GtkTooltips *tooltips) { @@ -60,6 +78,7 @@ expose_handler (GtkTooltips *tooltips) return FALSE; } +#endif void meta_fixed_tip_show (Display *xdisplay, int screen_number, @@ -93,8 +112,13 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, gtk_widget_set_name (tip, "gtk-tooltips"); gtk_container_set_border_width (GTK_CONTAINER (tip), 4); + #if GTK_CHECK_VERSION(3, 0, 0) + g_signal_connect (tip, "draw", + G_CALLBACK (draw_handler), NULL); + #else g_signal_connect_swapped (tip, "expose_event", G_CALLBACK (expose_handler), NULL); + #endif label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); |