Re: possible to detect if window is on active desktop, or not?



Le jeudi 12 mai 2005 Ã 22:06 +0200, Olivier Sessink a Ãcrit :
Hi all,
Hello,
is it possible to detect if a window is on the current desktop of the
user? (if the user is using virtual desktops?).

I have an application that can have different documents open in diffeent
windows, and each of these windows could be on a different virtual
desktop. And I want to avoid that a dialog box is shown for a document
that is not on the current virtual desktop. So I only want to give dialogs
for windows that are on the current desktop.

This involves the window manager (not available on eg windows), which is
available through libwnck (documentation available with devhelp).
Here is an untested snippet:
WnckWorkspace * current_wp;
WnckWindow * child_wn, * parent_wn;
child_wn = wnck_window_get (
        gdk_x11_drawable_get_xid (gtk_widget_get_parent_window (
                GTK_WIDGET (child_gtk_window))));
parent_wn = wnck_window_get (
        gdk_x11_drawable_get_xid (gtk_widget_get_parent_window (
                GTK_WIDGET (parent_gtk_window))));
current_wp = wnck_window_get_workspace (parent_wn);
if (wnck_window_is_visible_on_workspace (
        child_wn, parent_wp))
        ...





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]