Xfce Forum

Sub domains
 

You are not logged in.

#1 2010-09-18 10:45:58

kalleanka
Member
Registered: 2010-09-17
Posts: 2

WM-setting and moving window? [SOLVED]

Hi,
I wrote a small program to test a small problem I have with xfwm4 in xubuntu. The wm do not follow the placement hint if i change them in runtime. So how do i set the xfwm settings so the second window do not move to x = 10 when i want x = 0? Is it possible? Or shall i look for another wm? This is for a kiosk. Or maybe i can pass some hint to wm from my code to solve the problem?

Thanks.

int main(int argc, char **argv)
{  
    gtk_init(&argc, &argv);

    GtkWidget *win1;
    GtkWidget *win2;
    GdkColor col1;
    GdkColor col2;

    gint x2;


    win1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
    gdk_color_parse("#00f", &col1);
    gtk_widget_modify_bg(win1, GTK_STATE_NORMAL, &col1);

    gtk_window_set_decorated(GTK_WINDOW(win1), FALSE);
    //gtk_window_set_keep_above(GTK_WINDOW(win1), TRUE);
    gtk_window_set_keep_below(GTK_WINDOW(win1),TRUE);
    gtk_window_set_skip_taskbar_hint(GTK_WINDOW(win1), TRUE);
    gtk_window_set_skip_pager_hint(GTK_WINDOW(win1), TRUE);
    
    gtk_window_resize(GTK_WINDOW(win1), 200, 200);
    gtk_window_move(GTK_WINDOW(win1), 5, 100);
    gtk_widget_show_all(win1);



    win2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    gdk_color_parse("#f00", &col2);
    gtk_widget_modify_bg(win2, GTK_STATE_NORMAL, &col2);

    gtk_window_set_decorated(GTK_WINDOW(win2), FALSE);
    gtk_window_set_keep_above(GTK_WINDOW(win2), TRUE);
    //gtk_window_set_keep_below(GTK_WINDOW(win2),TRUE);
    gtk_window_set_skip_taskbar_hint(GTK_WINDOW(win2), TRUE);
    gtk_window_set_skip_pager_hint(GTK_WINDOW(win2), TRUE);
    x2 = 100;
    gtk_window_resize(GTK_WINDOW(win2), 5, 200);
    gtk_window_move(GTK_WINDOW(win2), x2, 100);
    gtk_widget_show_all(win2);
    x2 = 0;
    gtk_window_move(GTK_WINDOW(win2), x2, 100);
    gtk_widget_show_all(win2);

    gtk_main();

    return (EXIT_SUCCESS);
}

Offline

#2 2010-09-23 12:23:51

kalleanka
Member
Registered: 2010-09-17
Posts: 2

Re: WM-setting and moving window? [SOLVED]

ok, I solved it with an ugly hack. I destroyed the widget and recreated it. Then placements works. One have to filter signals so this only happens when needed otherwise preformance will be bad.

I wonder if this is a xfwm  or X problem?

Offline

#3 2010-09-24 19:35:39

herd
Member
From: Germany
Registered: 2006-05-18
Posts: 143
Website

Re: WM-setting and moving window? [SOLVED]

I'd rather go and use gdk_window_set_geometry_hints and friends b/c gtk_window_* is more for drawables on a window, methinks.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 9 queries executed - Memory usage: 522.35 KiB (Peak: 522.98 KiB) ]