summaryrefslogtreecommitdiff
path: root/typing-break
diff options
context:
space:
mode:
Diffstat (limited to 'typing-break')
-rw-r--r--typing-break/drw-break-window.c33
-rw-r--r--typing-break/drw-monitor.c2
-rw-r--r--typing-break/drw-utils.c31
-rw-r--r--typing-break/drwright.c5
4 files changed, 20 insertions, 51 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 4c3484c3..87e7ec3f 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -87,7 +87,7 @@ static void label_size_request_cb (GtkLabel *label,
G_DEFINE_TYPE (DrwBreakWindow, drw_break_window, GTK_TYPE_WINDOW)
-static guint signals[LAST_SIGNAL];
+static guint signals[LAST_SIGNAL] = { 0 };
static void
drw_break_window_class_init (DrwBreakWindowClass *klass)
@@ -605,7 +605,7 @@ label_expose_event_cb (GtkLabel *label,
GtkWidget *widget;
GdkWindow *window;
#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkGC *gc;
+ cairo_t *cr;
#endif
color.red = 0;
@@ -618,23 +618,24 @@ label_expose_event_cb (GtkLabel *label,
widget = GTK_WIDGET (label);
window = gtk_widget_get_window (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gc = gdk_gc_new (window);
- gdk_gc_set_rgb_fg_color (gc, &color);
- gdk_gc_set_clip_rectangle (gc, &event->area);
-#endif
-
#if GTK_CHECK_VERSION (3, 0, 0)
pango_cairo_show_layout (cr, gtk_label_get_layout (label));
#else
- gdk_draw_layout_with_colors (window,
- gc,
- x + 1,
- y + 1,
- gtk_label_get_layout (label),
- &color,
- NULL);
- g_object_unref (gc);
+ cr = gdk_cairo_create (window);
+
+ gdk_cairo_rectangle (cr, &event->area);
+ cairo_clip (cr);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ /* Can't use pango_cairo_show_layout() here as we need to override
+ * the layout's colors with our shadow color.
+ */
+ cairo_move_to (cr, x + 1, y + 1);
+ pango_cairo_layout_path (cr, gtk_label_get_layout (label));
+ cairo_fill (cr);
+
+ cairo_destroy (cr);
#endif
gtk_paint_layout (gtk_widget_get_style (widget),
diff --git a/typing-break/drw-monitor.c b/typing-break/drw-monitor.c
index 9659086b..027f22b5 100644
--- a/typing-break/drw-monitor.c
+++ b/typing-break/drw-monitor.c
@@ -56,7 +56,7 @@ static void drw_monitor_finalize (GObject *object);
static gboolean drw_monitor_setup (DrwMonitor *monitor);
static GObjectClass *parent_class;
-static guint signals[LAST_SIGNAL];
+static guint signals[LAST_SIGNAL] = { 0 };
GType
diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c
index 0bf27c59..5c28db98 100644
--- a/typing-break/drw-utils.c
+++ b/typing-break/drw-utils.c
@@ -157,14 +157,10 @@ set_pixmap_background (GtkWidget *window)
{
GdkScreen *screen;
GdkPixbuf *tmp_pixbuf, *pixbuf, *tile_pixbuf;
-#if GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr;
-#else
- GdkPixmap *pixmap;
-#endif
GdkRectangle rect;
GdkColor color;
gint width, height;
+ cairo_t *cr;
gtk_widget_realize (window);
@@ -222,38 +218,13 @@ set_pixmap_background (GtkWidget *window)
g_object_unref (tile_pixbuf);
-#if GTK_CHECK_VERSION (3, 0, 0)
cr = gdk_cairo_create (gtk_widget_get_window (window));
gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf, 0, 0);
cairo_paint (cr);
-#else
- pixmap = gdk_pixmap_new (gtk_widget_get_window (window),
- width,
- height,
- -1);
-
- gdk_draw_pixbuf (pixmap,
- NULL,
- tmp_pixbuf,
- 0,
- 0,
- 0,
- 0,
- width,
- height,
- GDK_RGB_DITHER_NONE,
- 0,
- 0);
-#endif
g_object_unref (tmp_pixbuf);
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_destroy (cr);
-#else
- gdk_window_set_back_pixmap (gtk_widget_get_window (window), pixmap, FALSE);
- g_object_unref (pixmap);
-#endif
}
void
diff --git a/typing-break/drwright.c b/typing-break/drwright.c
index 219ab19f..c526bec8 100644
--- a/typing-break/drwright.c
+++ b/typing-break/drwright.c
@@ -33,11 +33,8 @@
#include <libappindicator/app-indicator.h>
#endif /* HAVE_APP_INDICATOR */
-#if GTK_CHECK_VERSION (3, 0, 0)
#define MATE_DESKTOP_USE_UNSTABLE_API
#include <libmate-desktop/mate-desktop-utils.h>
-#define gdk_spawn_command_line_on_screen mate_gdk_spawn_command_line_on_screen
-#endif
#include "drwright.h"
#include "drw-break-window.h"
@@ -604,7 +601,7 @@ popup_preferences_cb (GtkAction *action, DrWright *dr)
menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
screen = gtk_widget_get_screen (menu);
- if (!gdk_spawn_command_line_on_screen (screen, "mate-keyboard-properties --typing-break", &error)) {
+ if (!mate_gdk_spawn_command_line_on_screen (screen, "mate-keyboard-properties --typing-break", &error)) {
GtkWidget *error_dialog;
error_dialog = gtk_message_dialog_new (NULL, 0,