Getting workspace number?




Dear All,

I would like to write a command line application that outputs the current workspace (under GNOME, I had someting in WindowMaker, but this does not work in GNOME). I have tried the following:

int main(int argc, char** argv) {
        gtk_init(&argc, &argv);
        WnckScreen *screen = wnck_screen_get_default();
        printf("Screen = %ld\n", screen);
        WnckWorkspace *space = wnck_screen_get_active_workspace(screen);
        printf("Workspace = %ld\n", space);
        int nr = wnck_workspace_get_number(space);
        printf("NR = %d\n", nr);
}

But this does not work because wnck_screen_get_active_workspace returns NULL, i.e., workspace is NULL.

Any ideas?

Thank you very much in advance.

With kind regards,

Jan Struyf.



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