sciapp / gr

GR framework: a graphics library for visualisation applications
Other
329 stars 54 forks source link

GKS demo app displays a blank window with tiling window managers #62

Closed c42f closed 5 years ago

c42f commented 5 years ago

Reported over at https://github.com/jheinen/GR.jl/issues/124, but really a GR issue:

Running the lib/gks/demo application on ubuntu18.04 with the i3wm tiling window manager results in a blank window. Forcing the WM to float the window (in this case using for_window [class="gksqt"] floating enable in .i3/config) works around the problem to some extent, but makes managing the GR windows difficult in the tiling environment.

When starting the demo app in tiling mode, no amount of resizing or refloating the window seems to make the expected image appear.

c42f commented 5 years ago

This appears to be a bug related to the has_been_resized handling in qtplugin_impl.cxx: for tiling window managers, the window will have been resized immediately when newWidget() is called, before the rest of the application has a chance to draw on the pixmap. So p->window will never be set at

https://github.com/jheinen/gr/blob/c0e565ca360489e6ea1e618ad810ac9f3c46d905/lib/gks/plugin/qtplugin_impl.cxx#L1012

It looks like Qt (until very recent releases) also has a resizing bug with tiling WM's which means the resizeEvent() receives the wrong size after a call to resize() https://bugreports.qt.io/browse/QTBUG-57608

jheinen commented 5 years ago

This problem should be fixe in GR master (https://github.com/jheinen/gr/commit/70968efd84fc7e6053d102ff5bd4a88663324000) . Thanks to @FlorianRhiem !

c42f commented 5 years ago

Thanks! This has fixed the blank window.