You are not logged in.
Pages: 1
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
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
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
Pages: 1
[ Generated in 0.009 seconds, 9 queries executed - Memory usage: 522.35 KiB (Peak: 522.98 KiB) ]