Re: contol the position of Gtk_Window related the X Display



WAN Hing Wah <50191914@ee.cityu.edu.hk> writes:
> although it work,I want to let user change to window position by draging
> the title bar using window manager's feature,but after user have moved
> the windows,a call to gtk_widget_hide() and then gtk_widget_show again
> make the windows appear again at the position which
> gtk_widget_set_uposition() is set..How can I maintain the current window
> position set by the user?

It's possible that simply unsetting the uposition will work. To unset
the uposition try setting it to -1, -1 (although either this or
set_usize() was broken for -1, -1, I don't remember). The window
manager may then remember the old position.

If that fails, you can get the current position with
gdk_window_get_origin() (or gdk_window_get_deskrelative_origin() or
gdk_window_get_root_origin(), I can honestly never remember which one
is correct), Note that these functions operate on widget->window
(GdkWindow) not on the GtkWindow.

Then you can reset the uposition based on that.

Havoc







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