~jderose/ubuntu/utopic/unity-settings-daemon/tune-syndaemon

« back to all changes in this revision

Viewing changes to plugins/media-keys/what-did-you-plug-in/dialog-window.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, David Henningsson
  • Date: 2014-03-10 17:25:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140310172556-3uc5zpm9vhs8s7fv
Tags: 14.04.0+14.04.20140310-0ubuntu1
[ David Henningsson ]
Fix what-did-you-plug-in dialog showing up behind other windows.
Simplify launching of "unity-control-center sound". (LP: #1287584)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#include <glib/gi18n.h>
3
3
#include <gtk/gtk.h>
4
4
#include <gdk-pixbuf/gdk-pixbuf.h>
 
5
#include <gdk/gdkx.h>
5
6
 
6
7
#include "dialog-window.h"
7
8
 
82
83
 
83
84
static void dialog_create(dialog_window *d, bool show_headset, bool show_mic)
84
85
{
 
86
    guint32 timestamp;
85
87
    d->dialog = gtk_dialog_new();
86
88
    gtk_window_set_title(GTK_WINDOW(d->dialog), _("Unknown Audio Device"));
87
89
    gtk_container_set_border_width(GTK_CONTAINER(d->dialog), 6);
117
119
    g_signal_connect(d->dialog, "response", G_CALLBACK(on_response), d);
118
120
 
119
121
    gtk_widget_show_all(d->dialog);
 
122
    /* This event did not originate from a pointer or key movement, so we can't
 
123
       use GDK_CURRENT_TIME (or just gtk_window_present) here. There is also no
 
124
       other source timestamp to rely on. Without a timestamp, the dialog would
 
125
       often show up behind other windows. */
 
126
    timestamp = gdk_x11_get_server_time(gtk_widget_get_window(GTK_WIDGET(d->dialog)));
 
127
    gtk_window_present_with_time(GTK_WINDOW(d->dialog), timestamp);
120
128
}
121
129
 
122
130
void wdypi_dialog_run(bool show_headset, bool show_mic, wdypi_dialog_cb cb, void *cb_userdata)