changeset 2191:329267b09658

get rid of talking with GDK directly
author Eugene Zagidullin <e.asphyx@gmail.com>
date Wed, 28 Nov 2007 02:50:15 +0300
parents 36b9f3e6cbcf
children e5401b6c4665
files src/demac/plugin.c src/vorbis/vorbis.c
diffstat 2 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/demac/plugin.c	Tue Nov 27 18:03:20 2007 +0300
+++ b/src/demac/plugin.c	Wed Nov 28 02:50:15 2007 +0300
@@ -66,6 +66,7 @@
 static unsigned long seek_to_msec=(unsigned long)-1; /* -1 == not needed */
 
 static InputPlugin demac_ip;
+static GtkWidget *about_window = NULL;
 
 #ifdef DEBUG
 # include "crc.c"
@@ -369,19 +370,17 @@
 }
 
 static void demac_about(void) {
-    static GtkWidget *about_window = NULL;
 
-    if (about_window)
-      gdk_window_raise(about_window->window);
-    else {
+    if (about_window) {
+      gtk_window_present(GTK_WINDOW(about_window));
+    } else {
       about_window = audacious_info_dialog(_("About Monkey's Audio Plugin"),
                                        _("Copyright (C) 2007 Eugene Zagidullin <e.asphyx@gmail.com>\n"
                                         "Based on ffape decoder, Copyright (C) 2007 Benjamin Zores\n"
 					"ffape itself based on libdemac by Dave Chapman\n\n"
 					"ffape is a part of FFmpeg project, http://ffmpeg.mplayerhq.hu/"),
                                        _("Ok"), FALSE, NULL, NULL);
-      g_signal_connect(G_OBJECT(about_window), "destroy",
-                       G_CALLBACK(gtk_widget_destroyed), &about_window);
+      g_signal_connect(G_OBJECT(about_window), "destroy", G_CALLBACK(gtk_widget_destroyed), &about_window);
     }
 }
 
--- a/src/vorbis/vorbis.c	Tue Nov 27 18:03:20 2007 +0300
+++ b/src/vorbis/vorbis.c	Wed Nov 28 02:50:15 2007 +0300
@@ -126,6 +126,7 @@
 GMutex *vf_mutex;
 
 gchar **vorbis_tag_encoding_list = NULL;
+static GtkWidget *about_window;
 
 static int
 vorbis_check_fd(char *filename, VFSFile *stream)
@@ -725,10 +726,8 @@
 static void
 vorbis_aboutbox(void)
 {
-    static GtkWidget *about_window;
-
     if (about_window)
-        gdk_window_raise(about_window->window);
+        gtk_window_present(GTK_WINDOW(about_window));
     else
     {
       about_window = audacious_info_dialog(_("About Ogg Vorbis Audio Plugin"),