コード例 #1
0
/* This is similar to gs_grab_grab_window but doesn't fail */
void
gs_grab_move_to_window (GSGrab    *grab,
                        GdkWindow *window,
                        GdkScreen *screen,
                        gboolean   hide_cursor)
{
    gboolean result = FALSE;

    g_return_if_fail (GS_IS_GRAB (grab));

    xorg_lock_smasher_set_active (grab, FALSE);

    do
    {
        result = gs_grab_move_keyboard (grab, window, screen);
        gdk_flush ();
    }
    while (!result);

    do
    {
        result = gs_grab_move_mouse (grab, window, screen, hide_cursor);
        gdk_flush ();
    }
    while (!result);
}
コード例 #2
0
ファイル: gs-grab-x11.c プロジェクト: GNOME/gnome-screensaver
void
gs_grab_release (GSGrab *grab)
{
        gs_debug ("Releasing all grabs");

        gs_grab_release_mouse (grab);
        gs_grab_release_keyboard (grab);

        /* FIXME: is it right to enable this ? */
        xorg_lock_smasher_set_active (grab, TRUE);

        gdk_display_sync (gdk_display_get_default ());
        gdk_flush ();
}