[Xfce4-commits] <xfce4-timer-plugin:master> More fixes

Kemal Ilgar Eroglu noreply at xfce.org
Mon Feb 6 21:52:01 CET 2012


Updating branch refs/heads/master
         to 0e8dd7a1ab4ed38bc3e0a55c2f8fc9aece5555f8 (commit)
       from 5475c202da83f16f641d0da0e1c07146e07904f5 (commit)

commit 0e8dd7a1ab4ed38bc3e0a55c2f8fc9aece5555f8
Author: Kemal Ilgar Eroglu <ilgar_eroglu at yahoo.com>
Date:   Mon Feb 6 22:50:59 2012 +0200

    More fixes

 ChangeLog       |    1 +
 configure.in.in |    1 +
 src/xfcetimer.c |   41 +++++++++++++++++++++++++++++++++--------
 3 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 434b4fb..95a891c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 	* Version 0.6.4
 	* Commit patch by Guido Berhoerster, replacing certain fixed-size strings with variable-size code. Fixes bug 8420.
 	* Commit patch by Guido Berhoerster, making the notification dialog modal and the add/edit window transient for the configuration window. Fixes bug 8420.
+	* The mouse click receive code is separated for pre-4.8 and 4.8 panels (couldn't make them work simultaneously).
 	* Added an icon (thanks to Ilgim Eroglu).
 05/01/2012 Kemal Ilgar Eroglu <ilgar_eroglu at yahoo.com>
 	* Version 0.6.3
diff --git a/configure.in.in b/configure.in.in
index 1941f05..cad5891 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -34,6 +34,7 @@ XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.4.0])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.4.0])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.2.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20])
+XDT_CHECK_OPTIONAL_PACKAGE([XFCE48], [libxfce4panel-1.0], [4.8.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.0])
 
 
diff --git a/src/xfcetimer.c b/src/xfcetimer.c
index 0bda1e7..c914507 100644
--- a/src/xfcetimer.c
+++ b/src/xfcetimer.c
@@ -703,7 +703,7 @@ static void add_edit_clicked (GtkButton *buttonn, gpointer data){
   adata->pd=pd;
 
   gtk_window_set_modal(GTK_WINDOW(window),TRUE);
-  parent_window = gtk_widget_get_toplevel(buttonn);
+  parent_window = gtk_widget_get_toplevel(GTK_WIDGET(buttonn));
   if (gtk_widget_is_toplevel(parent_window))
       gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(parent_window));
 
@@ -1011,10 +1011,11 @@ static void down_clicked(GtkButton *button, gpointer data){
 **/
 static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
 
-  //g_signal_handler_disconnect (G_OBJECT(plugin), pd->handler);
-
+//#ifdef HAVE_XFCE48
   gtk_widget_hide(GTK_WIDGET(plugin));
-
+//#else
+//  gtk_widget_hide(GTK_WIDGET(pd->eventbox));
+//#endif
   xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
 
   /* Always true except at initialization */
@@ -1027,7 +1028,11 @@ static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
   /* vertical bar */
   if(xfce_panel_plugin_get_orientation(plugin)==GTK_ORIENTATION_HORIZONTAL){
     pd->box=gtk_hbox_new(TRUE,0);
+#ifdef HAVE_XFCE48    
     gtk_container_add(GTK_CONTAINER(plugin),pd->box);
+#else    
+    gtk_container_add(GTK_CONTAINER(pd->eventbox),pd->box);
+#endif
     gtk_progress_bar_set_orientation    (GTK_PROGRESS_BAR(pd->
                     pbar),GTK_PROGRESS_BOTTOM_TO_TOP);
     gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),PBAR_THICKNESS,0);
@@ -1038,7 +1043,11 @@ static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
   }
   else{ /* horizontal bar */
     pd->box=gtk_vbox_new(TRUE,0);
+#ifdef HAVE_XFCE48    
     gtk_container_add(GTK_CONTAINER(plugin),pd->box);
+#else    
+    gtk_container_add(GTK_CONTAINER(plugin),pd->eventbox);
+#endif
     gtk_progress_bar_set_orientation    (GTK_PROGRESS_BAR(pd->
                     pbar),GTK_PROGRESS_LEFT_TO_RIGHT);
     gtk_widget_set_size_request(GTK_WIDGET(pd->pbar),0,PBAR_THICKNESS);
@@ -1048,10 +1057,11 @@ static void add_pbar(XfcePanelPlugin *plugin, plugin_data *pd){
 
   }
   
-  gtk_widget_show_all(GTK_WIDGET(plugin));
-
-  g_signal_connect  (G_OBJECT(plugin), "button_press_event",
-            G_CALLBACK(pbar_clicked), pd);       
+#ifdef HAVE_XFCE48
+  gtk_widget_show_all(GTK_WIDGET(plugin)); 
+#else
+  gtk_widget_show_all(GTK_WIDGET(pd->eventbox));
+#endif
 }
 
 /**
@@ -1303,6 +1313,9 @@ plugin_free (XfcePanelPlugin *plugin, plugin_data *pd)
     g_array_free(pd->menuarray,TRUE);
 
   /* destroy all widgets */
+#ifndef HAVE_XFCE48
+	gtk_widget_destroy(GTK_WIDGET(pd->eventbox));
+#endif  
 
   /* destroy the tooltips */
   /*gtk_object_destroy(GTK_OBJECT(pd->tip));*/
@@ -1578,6 +1591,9 @@ create_plugin_control (XfcePanelPlugin *plugin)
          G_TYPE_INT);    /* Timer period in seconds if countdown.
                     Alarm time in minutes if 24h format is used,
                     (i.e. 60 x Hr + Min) */
+#ifndef HAVE_XFCE48
+  pd->eventbox = gtk_event_box_new();
+#endif  
   pd->box=NULL;
   pd->timer_on=FALSE;
   pd->timeout=0;
@@ -1627,6 +1643,15 @@ create_plugin_control (XfcePanelPlugin *plugin)
   gtk_widget_set_size_request(GTK_WIDGET(plugin),10,10);
   xfce_panel_plugin_set_expand(plugin,FALSE);
 
+#ifdef HAVE_XFCE48
+  g_signal_connect  (G_OBJECT(plugin), "button_press_event",
+            G_CALLBACK(pbar_clicked), pd);      
+#else
+  gtk_container_add(GTK_CONTAINER(plugin),pd->eventbox);
+  g_signal_connect  (G_OBJECT(pd->eventbox), "button_press_event",
+            G_CALLBACK(pbar_clicked), pd);
+#endif  
+
   gtk_widget_show_all(GTK_WIDGET(plugin));
 
   g_signal_connect (plugin, "free-data",


More information about the Xfce4-commits mailing list