r38 - unstable/rutilt/debian/patches
benh at alioth.debian.org
benh at alioth.debian.org
Sun Oct 7 21:46:19 UTC 2007
Author: benh
Date: 2007-10-07 21:46:19 +0000 (Sun, 07 Oct 2007)
New Revision: 38
Added:
unstable/rutilt/debian/patches/011_fix_trayicon_toggle.diff
Modified:
unstable/rutilt/debian/patches/series
Log:
Added patch to work around a bug somewhere (GtkPlug?) which means hiding the tray icon destroys it.
Added: unstable/rutilt/debian/patches/011_fix_trayicon_toggle.diff
===================================================================
--- unstable/rutilt/debian/patches/011_fix_trayicon_toggle.diff (rev 0)
+++ unstable/rutilt/debian/patches/011_fix_trayicon_toggle.diff 2007-10-07 21:46:19 UTC (rev 38)
@@ -0,0 +1,128 @@
+--- rutilt.orig/lib/src/TrayIcon.cxx
++++ rutilt/lib/src/TrayIcon.cxx
+@@ -28,15 +28,49 @@
+
+ nsGUI::CTrayIcon::CTrayIcon (const std::string& FileName,
+ ::GCallback CallBack, void* pData) throw()
+- : m_pTrayIcon (GTK_WIDGET (::egg_tray_icon_new ("RutilT"))),
+- m_pIcon (GTK_IMAGE (::gtk_image_new_from_file (FileName.c_str()))),
++ : m_pTrayIcon (0),
++ m_pIcon (0),
+ m_pToolTipsGroup (::gtk_tooltips_new()),
+- m_CurrentIconFileName (FileName)
++ m_CurrentIconFileName (FileName),
++ m_CallBack (CallBack),
++ m_pCallBackData (pData)
+ {
++} // CTrayIcon()
++
++
++nsGUI::CTrayIcon::~CTrayIcon () throw()
++{
++ if (m_pTrayIcon)
++ ::gtk_widget_destroy (GTK_WIDGET (m_pTrayIcon));
++ ::gtk_object_destroy (GTK_OBJECT (m_pToolTipsGroup));
++
++} // ~CTrayIcon()
++
++
++void nsGUI::CTrayIcon::Show () throw()
++{
++ if (m_pTrayIcon)
++ return;
++
++ m_pTrayIcon = GTK_WIDGET (::egg_tray_icon_new ("RutilT"));
++ m_pIcon = GTK_IMAGE (::gtk_image_new_from_file
++ (m_CurrentIconFileName.c_str()));
+ ::GtkWidget* const pEventBox (::gtk_event_box_new());
+ ::g_signal_connect_swapped (G_OBJECT (pEventBox), "button-press-event",
+- CallBack, pData);
++ m_CallBack, m_pCallBackData);
+ ::gtk_container_add (GTK_CONTAINER (pEventBox), GTK_WIDGET (m_pIcon));
+ ::gtk_container_add (GTK_CONTAINER (m_pTrayIcon), pEventBox);
++ ::gtk_widget_show_all (m_pTrayIcon);
+
+-} // CTrayIcon()
++} // Show()
++
++
++void nsGUI::CTrayIcon::Hide () throw()
++{
++ if (!m_pTrayIcon)
++ return;
++
++ ::gtk_widget_destroy (m_pTrayIcon);
++ m_pTrayIcon = 0;
++
++} // Hide()
+--- rutilt.orig/include/TrayIcon.h
++++ rutilt/include/TrayIcon.h
+@@ -36,6 +36,7 @@
+ public :
+ // Callback : void (*) (void*, ::GdkEventButton*) throw();
+ CTrayIcon (const std::string&, ::GCallback, void*) throw();
++ ~CTrayIcon () throw();
+ void SetIcon (const std::string&) throw();
+ void SetTooltip (const std::string&) throw();
+ void Show () throw();
+@@ -44,10 +45,12 @@
+
+
+ private :
+- ::GtkWidget* const m_pTrayIcon;
+- ::GtkImage* const m_pIcon;
++ ::GtkWidget* m_pTrayIcon;
++ ::GtkImage* m_pIcon;
+ ::GtkTooltips* const m_pToolTipsGroup;
+ std::string m_CurrentIconFileName;
++ ::GCallback const m_CallBack;
++ void* const m_pCallBackData;
+
+ }; // CTrayIcon
+
+--- rutilt.orig/include/private/TrayIcon.hxx
++++ rutilt/include/private/TrayIcon.hxx
+@@ -23,37 +23,25 @@
+ {
+ if (FileName != m_CurrentIconFileName)
+ {
+- ::gtk_image_set_from_file (m_pIcon, FileName.c_str());
+- std::cout << "set icon filename to " << FileName << "\n";
++ if (m_pIcon)
++ ::gtk_image_set_from_file (m_pIcon, FileName.c_str());
+ m_CurrentIconFileName = FileName;
+ }
+
+ } // SetIcon()
+
+
+-inline void nsGUI::CTrayIcon::Show () throw()
+-{
+- ::gtk_widget_show_all (m_pTrayIcon);
+-
+-} // Show()
+-
+-
+-inline void nsGUI::CTrayIcon::Hide () throw()
+-{
+- ::gtk_widget_hide (m_pTrayIcon);
+-
+-} // Hide()
+-
+-
+ inline void nsGUI::CTrayIcon::SetTooltip (const std::string& Text) throw()
+ {
+- ::gtk_tooltips_set_tip (m_pToolTipsGroup, m_pTrayIcon, Text.c_str(), 0);
++ if (m_pTrayIcon)
++ ::gtk_tooltips_set_tip (m_pToolTipsGroup, m_pTrayIcon,
++ Text.c_str(), 0);
+
+ } // SetTooltip()
+
+
+ inline bool nsGUI::CTrayIcon::IsVisible () const throw()
+ {
+- return GTK_WIDGET_VISIBLE (m_pTrayIcon);
++ return m_pTrayIcon != 0;
+
+ } // IsVisible()
Modified: unstable/rutilt/debian/patches/series
===================================================================
--- unstable/rutilt/debian/patches/series 2007-10-07 19:35:34 UTC (rev 37)
+++ unstable/rutilt/debian/patches/series 2007-10-07 21:46:19 UTC (rev 38)
@@ -5,6 +5,7 @@
008_fix_row_toggled.diff
009_remove_unsafe_signal_handler.diff
010_fix_cflags.diff
+011_fix_trayicon_toggle.diff
001_fix_desktop.diff
002_fix_install.diff
003_fix_ELF_location.diff
More information about the Pkg-ralink-commits
mailing list