~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to src/clipboard.c

  • Committer: Michael Terry
  • Date: 2010-10-05 16:33:46 UTC
  • mto: This revision was merged to the branch mainline in revision 596.
  • Revision ID: mike@mterry.name-20101005163346-vbxd68bcj5wavrhv
* Add --disable-deprecations configure flag to test for deprecated API use
* Don't use deprecated API, and update required version of GTK+ to match
  LP: #655231

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        gboolean retval = FALSE;
48
48
        GtkClipboard *clipboard;
49
49
        Atom atom;
 
50
        Display *display;
50
51
 
51
52
        atom = gdk_x11_get_xatom_by_name (CLIPBOARD_NAME);
52
 
 
53
 
        XGrabServer (GDK_DISPLAY ());
54
 
 
55
 
        if (XGetSelectionOwner (GDK_DISPLAY (), atom) != None)
 
53
        display = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
 
54
 
 
55
        XGrabServer (display);
 
56
 
 
57
        if (XGetSelectionOwner (display, atom) != None)
56
58
                goto out;
57
59
 
58
60
        clipboard = gtk_clipboard_get (gdk_atom_intern (CLIPBOARD_NAME, FALSE));
64
66
                retval = TRUE;
65
67
 
66
68
out:
67
 
        XUngrabServer (GDK_DISPLAY ());
 
69
        XUngrabServer (display);
68
70
        gdk_flush ();
69
71
 
70
72
        return retval;