~ubuntu-branches/ubuntu/precise/gnome-control-center/precise-updates

« back to all changes in this revision

Viewing changes to libslab/libslab-utils.c

Tags: upstream-2.27.5
ImportĀ upstreamĀ versionĀ 2.27.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include <sys/resource.h>
13
13
#include <sys/time.h>
14
14
#include <gconf/gconf-value.h>
15
 
#include <libgnome/gnome-url.h>
 
15
#include <gtk/gtk.h>
16
16
 
17
17
#define DESKTOP_ITEM_TERMINAL_EMULATOR_FLAG "TerminalEmulator"
18
18
#define ALTERNATE_DOCPATH_KEY               "DocPath"
180
180
        return path;
181
181
}
182
182
 
 
183
/* Ugh, here we don't have knowledge of the screen that is being used.  So, do
 
184
 * what we can to find it.
 
185
 */
 
186
GdkScreen *
 
187
libslab_get_current_screen (void)
 
188
{
 
189
        GdkEvent *event;
 
190
        GdkScreen *screen = NULL;
 
191
 
 
192
        event = gtk_get_current_event ();
 
193
        if (event) {
 
194
                if (event->any.window)
 
195
                        screen = gdk_drawable_get_screen (GDK_DRAWABLE (event->any.window));
 
196
 
 
197
                gdk_event_free (event);
 
198
        }
 
199
 
 
200
        if (!screen)
 
201
                screen = gdk_screen_get_default ();
 
202
 
 
203
        return screen;
 
204
}
 
205
 
183
206
gboolean
184
207
libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item)
185
208
{
199
222
        if (doc_path) {
200
223
                help_uri = g_strdup_printf ("ghelp:%s", doc_path);
201
224
 
202
 
                gtk_show_uri (NULL, help_uri, gtk_get_current_event_time (), &error);
203
 
 
204
 
                if (error) {
 
225
                if (!gtk_show_uri (libslab_get_current_screen (), help_uri, gtk_get_current_event_time (), &error)) {
205
226
                        g_warning ("error opening %s [%s]\n", help_uri, error->message);
206
227
 
207
228
                        g_error_free (error);
572
593
}
573
594
 
574
595
static guint thumbnail_factory_idle_id;
575
 
static GnomeThumbnailFactory *thumbnail_factory;
 
596
static GnomeDesktopThumbnailFactory *thumbnail_factory;
576
597
 
577
598
static void
578
599
create_thumbnail_factory (void)
585
606
 
586
607
        libslab_checkpoint ("create_thumbnail_factory(): start");
587
608
 
588
 
        thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
 
609
        thumbnail_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
589
610
 
590
611
        libslab_checkpoint ("create_thumbnail_factory(): end");
591
612
}
604
625
        thumbnail_factory_idle_id = g_idle_add (init_thumbnail_factory_idle_cb, NULL);
605
626
}
606
627
 
607
 
GnomeThumbnailFactory *
 
628
GnomeDesktopThumbnailFactory *
608
629
libslab_thumbnail_factory_get (void)
609
630
{
610
631
        if (thumbnail_factory_idle_id != 0) {