[Xfce4-commits] [apps/xfce4-notifyd] 03/29: Start porting the notification daemon to gtk3, without theming for the moment.

noreply at xfce.org noreply at xfce.org
Wed Jun 29 23:19:53 CEST 2016


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-notifyd.

commit eb033731005784a12d20b3405d7e279ed4908193
Author: Ali Abdallah <aliovx at gmail.com>
Date:   Sun Oct 11 20:47:15 2015 +0200

    Start porting the notification daemon to gtk3, without theming for the moment.
---
 AUTHORS                            |  1 +
 Makefile.am                        | 21 +++++++++------------
 configure.ac.in                    |  3 +--
 xfce4-notifyd/main.c               |  3 ++-
 xfce4-notifyd/xfce-notify-daemon.c | 10 ++++++----
 xfce4-notifyd/xfce-notify-window.c | 29 ++++++++++++++++-------------
 6 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 5b98ed0..560725a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 Brian Tarricone <bjt23 at cornell.edu>
 Jérôme Guelfucci <jeromeg at xfce.org>
+Ali Abdallah <ali at xfce.org>
\ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
index 4604a91..344de0d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,41 +41,38 @@ common_cflags = \
 	-I$(builddir)	\
 	-DLOCALEDIR=\"$(localedir)\" \
 	$(LIBXFCE4UTIL_CFLAGS) \
-	$(XFCONF_CFLAGS)
+	$(XFCONF_CFLAGS) \
+	$(LIBXFCE4UI_CFLAGS) \
+	$(GTK3_CFLAGS)
 
 xfce4_notifyd_xfce4_notifyd_CFLAGS = \
 	-DG_LOG_DOMAIN=\"xfce4-notifyd\" \
 	$(common_cflags) \
 	$(LIBX11_CFLAGS) \
 	$(GIO_CFLAGS) \
-	$(GIO_UNIX_CFLAGS) \
-	$(GTK_CFLAGS) \
-	$(LIBXFCE4UI_CFLAGS)
+	$(GIO_UNIX_CFLAGS)
 	
 
 xfce4_notifyd_config_xfce4_notifyd_config_CFLAGS = \
 	-DG_LOG_DOMAIN=\"xfce4-notifyd-config\" \
 	$(LIBNOTIFY_CFLAGS) \
-	$(LIBXFCE4UI2_CFLAGS) \
-	$(GTK3_CFLAGS) \
 	$(common_cflags)
 
 common_ldadd = \
 	$(LIBXFCE4UTIL_LIBS) \
-	$(XFCONF_LIBS)
+	$(XFCONF_LIBS) \
+	$(LIBXFCE4UI_LIBS) \
+	$(GTK3_LIBS)
 
 xfce4_notifyd_xfce4_notifyd_LDADD = \
 	$(common_ldadd) \
 	$(LIBX11_LIBS)	\
 	$(GIO_LIBS) \
-	$(GIO_UNIX_LIBS) \
-	$(LIBXFCE4UI_LIBS)
+	$(GIO_UNIX_LIBS)
 
 xfce4_notifyd_config_xfce4_notifyd_config_LDADD = \
 	$(common_ldadd) \
-	$(LIBXFCE4UI2_LIBS) \
-	$(LIBNOTIFY_LIBS) \
-	$(GTK3_LIBS)
+	$(LIBNOTIFY_LIBS)
 
 
 servicedir = $(datadir)/dbus-1/services
diff --git a/configure.ac.in b/configure.ac.in
index b47376e..b332650 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -62,8 +62,7 @@ XDT_CHECK_LIBX11_REQUIRE()
 
 dnl required
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UI2], [libxfce4ui-2], [4.10.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [0.1.0svn-r26876])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
 XDT_CHECK_PACKAGE([GTK3], [gtk+-3.0], [3.14.0])
diff --git a/xfce4-notifyd/main.c b/xfce4-notifyd/main.c
index 8fab30a..76de799 100644
--- a/xfce4-notifyd/main.c
+++ b/xfce4-notifyd/main.c
@@ -59,11 +59,12 @@ main(int argc,
      * update notifications' style.
      *
      * This has to be done before gtk_init. */
-
+	/*
     temp_theme_file = g_build_path(G_DIR_SEPARATOR_S, g_get_user_cache_dir(),
                                    "xfce4-notifyd-theme.rc", NULL);
 
     gtk_rc_add_default_file(temp_theme_file);
+	*/
 
     gtk_init(&argc, &argv);
 
diff --git a/xfce4-notifyd/xfce-notify-daemon.c b/xfce4-notifyd/xfce-notify-daemon.c
index 4276c78..dd24d68 100644
--- a/xfce4-notifyd/xfce-notify-daemon.c
+++ b/xfce4-notifyd/xfce-notify-daemon.c
@@ -1219,21 +1219,22 @@ static void
 xfce_notify_daemon_set_theme(XfceNotifyDaemon *xndaemon,
                              const gchar *theme)
 {
+   /* 
     GError *error = NULL;
     gchar  *file, **files;
     gchar  *string;
     gchar  *temp_theme_file;
 
     DBG("New theme: %s", theme);
-
+    */
     /* See main.c for an explanation on how the theming works and why
      * we use this temp file including the real file */
-
+/*
     temp_theme_file = g_build_path(G_DIR_SEPARATOR_S, g_get_user_cache_dir(),
                                    "xfce4-notifyd-theme.rc", NULL);
-
+*/
     /* old-style ~/.themes ... */
-    file = g_build_filename(xfce_get_homedir(), ".themes", theme,
+/*    file = g_build_filename(xfce_get_homedir(), ".themes", theme,
                             "xfce-notify-4.0", "gtkrc", NULL);
     if(g_file_test(file, G_FILE_TEST_EXISTS)) {
         string = g_strconcat("include \"", file, "\"", NULL);
@@ -1269,6 +1270,7 @@ xfce_notify_daemon_set_theme(XfceNotifyDaemon *xndaemon,
     g_free(temp_theme_file);
     g_free(file);
     g_strfreev(files);
+    */
 }
 
 
diff --git a/xfce4-notifyd/xfce-notify-window.c b/xfce4-notifyd/xfce-notify-window.c
index e2fc40a..d0bf218 100644
--- a/xfce4-notifyd/xfce-notify-window.c
+++ b/xfce4-notifyd/xfce-notify-window.c
@@ -411,7 +411,10 @@ xfce_notify_window_ensure_bg_path(XfceNotifyWindow *window,
     GtkWidget *widget = GTK_WIDGET(window);
     gdouble radius = DEFAULT_RADIUS;
     gdouble border_width = DEFAULT_BORDER_WIDTH;
+	GtkAllocation widget_allocation ;
 
+	gtk_widget_get_allocation (widget, &widget_allocation);
+	
     /* this secifies the border_padding from the edges in order to make
      * sure the border completely fits into the drawing area */
     gdouble border_padding = 0.0;
@@ -441,29 +444,29 @@ xfce_notify_window_ensure_bg_path(XfceNotifyWindow *window,
     border_padding = border_width / 2.0;
 
     if(radius < 0.1) {
-        cairo_rectangle(cr, 0, 0, widget->allocation.width,
-                        widget->allocation.height);
+        cairo_rectangle(cr, 0, 0, widget_allocation.width,
+                        widget_allocation.height);
     } else {
         cairo_move_to(cr, border_padding, radius + border_padding);
         cairo_arc(cr, radius + border_padding,
                   radius + border_padding, radius,
                   M_PI, 3.0*M_PI/2.0);
         cairo_line_to(cr,
-                      widget->allocation.width - radius - border_padding,
+                      widget_allocation.width - radius - border_padding,
                       border_padding);
         cairo_arc(cr,
-                  widget->allocation.width - radius - border_padding,
+                  widget_allocation.width - radius - border_padding,
                   radius + border_padding, radius,
                   3.0*M_PI/2.0, 0.0);
-        cairo_line_to(cr, widget->allocation.width - border_padding,
-                      widget->allocation.height - radius - border_padding);
-        cairo_arc(cr, widget->allocation.width - radius - border_padding,
-                  widget->allocation.height - radius - border_padding,
+        cairo_line_to(cr, widget_allocation.width - border_padding,
+                      widget_allocation.height - radius - border_padding);
+        cairo_arc(cr, widget_allocation.width - radius - border_padding,
+                  widget_allocation.height - radius - border_padding,
                   radius, 0.0, M_PI/2.0);
         cairo_line_to(cr, radius + border_padding,
-                      widget->allocation.height - border_padding);
+                      widget_allocation.height - border_padding);
         cairo_arc(cr, radius + border_padding,
-                  widget->allocation.height - radius - border_padding,
+                  widget_allocation.height - radius - border_padding,
                   radius, M_PI/2.0, M_PI);
         cairo_close_path(cr);
     }
@@ -479,10 +482,10 @@ xfce_notify_window_ensure_bg_path(XfceNotifyWindow *window,
      * the shape might further constrain the window, and because the
      * path flattening isn't an exact science, it looks ugly. */
     if(!gtk_widget_is_composited(widget))
-        gdk_window_shape_combine_region(widget->window, region, 0, 0);
+        gdk_window_shape_combine_region(gtk_widget_get_window(widget), region, 0, 0);
     /* however, of course always set the input shape; it doesn't matter
      * if this is a pixel or two off here and there */
-    gdk_window_input_shape_combine_region(widget->window, region, 0, 0);
+    gdk_window_input_shape_combine_region(gtk_widget_get_window(widget), region, 0, 0);
     gdk_region_destroy(region);
 
     cairo_new_path(cr);
@@ -505,7 +508,7 @@ xfce_notify_window_expose(GtkWidget *widget,
     if(evt->count != 0)
         return FALSE;
 
-    cr = gdk_cairo_create(widget->window);
+    cr = gdk_cairo_create(gtk_widget_get_window(widget));
     bg_path = xfce_notify_window_ensure_bg_path(window, cr);
 
     /* the idea here is we only do the fancy semi-transparent shaped

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list