/* Ask X to move to the desktop on which @window currently is * and the present @window. */ void empathy_move_to_window_desktop (GtkWindow *window, guint32 timestamp) { #ifdef GDK_WINDOWING_X11 GdkScreen *screen; Screen *xscreen; GdkWindow *gdk_window; int workspace; screen = gtk_window_get_screen (window); if (!GDK_IS_X11_SCREEN (screen)) goto out; xscreen = gdk_x11_screen_get_xscreen (screen); gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); workspace = window_get_workspace (xscreen, gdk_x11_window_get_xid (gdk_window)); if (workspace == -1) goto out; _wnck_activate_workspace (xscreen, workspace, timestamp); out: gtk_window_present_with_time (window, timestamp); #endif }
/** * wnck_workspace_activate: * @space: a #WnckWorkspace. * @timestamp: the X server timestamp of the user interaction event that caused * this call to occur. * * Asks the window manager to make @space the active workspace. The window * manager may decide to refuse the request (to not steal the focus if there is * a more recent user activity, for example). * * This function existed before 2.10, but the @timestamp argument was missing * in earlier versions. * * Since: 2.10 **/ void wnck_workspace_activate (WnckWorkspace *space, guint32 timestamp) { g_return_if_fail (WNCK_IS_WORKSPACE (space)); _wnck_activate_workspace (WNCK_SCREEN_XSCREEN (space->priv->screen), space->priv->number, timestamp); }