Shrinking GtkAplication widget

If I use the mouse to drag and enlarge the GtkApplication window, the following code does not shrink it back until the application windows looses focus (say by using Alt-Tab or the mouse to select another program window).

gtk_window_set_default_size ( GTK_WINDOW( wApplication ), -1, -1 );
while (g_main_context_pending (g_main_context_default ()))
g_main_context_iteration (NULL, TRUE);

Is there a way to cause the GtkApplication to respond without having to loose focus? (I’m not even sure I can get the program to loose focus under Wayland.)

BTW if I programmatically make a widget inside the GtkApplication bigger, the application widget grows (as you would expect) but it also shrinks back when I make the inside widget smaller (and use the code above). It is only the use of the mouse to expand the widget that causes this issue.

Michael

Hello,

this would be better suited for the Platform category.

GtkApplication is not a widget, it’s an application object.

I think what you’re asking about is programmatically restoring the initial (or otherwise small) window size after the user has resized the window; does that sound right?

Sort of… if I use gtk_window_set_default_size to set the size smaller that that to which it has been made by dragging the edge with the mouse, nothing happens until I loose focus. (this includes -1, -1)

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.