-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI: Default Single-Window size is too small #3024
wxGUI: Default Single-Window size is too small #3024
Conversation
Should this go to 8.3 release? It looks like a an important fix. Why is it draft? The TypeError is unrelated. |
Yes, it should go to the release 8.3.0, I initially set it up for version 8.3.0. This is a draft because I would like to test it more (it was very fast written). |
Single Window should probably start maximized by default. @lindakladivova @petrasovaa Any opinion? |
Well @landa, it actually is maximized by default but the problem is that we take the parameter defWindowPos (set by globalvar.GM_WINDOW_SIZE variable) from UserSettings if defined (rows 181 - 196). You can go to Settings -> General -> and check Suppress positioning Layer Manager window, close GRASS and start again and it will launch as maximized. IMHO This User setting does not make sense for Single-Window, I would suggest removing rows 181 - 196 in frame/main_window.py. @petrasovaa what do you think? Reminding me another thing (not related to this PR but also important): after the successful merge of #2667 we could finally remove the lmgr/frame.py file and possibly some other stuff like globalvar.GM_WINDOW_SIZE. Any opinions on this? Further, I have one more thing here, I would like to try to suppress the GTK warnings as @vero mentioned... it is also painful but I will at least try it and we will see.. |
By default without using this PR, single window mode size depend on the DE, respectively the type of window layout (floating, tiled, monocle) and OS wxGTK, wxMSW. wxMSW (floating windows layout) default single window size and position: wxGTK (floating windows layout with dwm window manager) default single window size and position (issue #3013): wxGTK (tiled/monocle windows layout with dwm window manager) default single window size and position: wxGTK (floating windows layout with Gnome DE) default single window size and position: Important user settings is Save current window layout as default which works as expected. You can change position and size of window (single window mode too).
It is not a good idea, if you remove these lines, the wxGUI single window mode will not respect the client area and will be overlapped by the DE panel(s). |
This would be the best thing to happen in GRASS for many years, in my eyes (I have the experience that when the users see those warnings and criticals, they consider GRASS to be broken and stop using it). Have had a discussion about that with @wenzeslaus and he can give a verbose, loquacious monologue on that. But we shouldn't make this issue a discussion forum keep sticking to the topic. |
Seems it is regression between revisions (respectively GRASS GIS versions)
wxGTK (floating windows layout with Gnome DE) default single window size and position:
wxGTK (floating windows layout with Gnome DE) default single window size and position:
|
@tmszi I will try to explain how I understand the problem, I might be wrong, please correct me. The size of wx.Frame is in the constructor given by wx.Display().GetGeometry().GetSize() by default (in my case e.g. (1920, 1080)). But the problem is that after calling self.Fit(), for some reason, the size of the main window is being changed and this is why I removed all self.Fit() callings. Not sure what happened between 8.3.0dev and 8.4.0dev versions but suddenly self.Fit() did not work. But! When I tested this Pull request I was quite annoyed by the fact that even after removing the Fit() calling, I could not reach the maximized extent (1920, 1080). The problem was that I was actually still overwriting the desired extent by the extent I had saved in the UserSettings (rows 181-197). Maybe I am not right, but I think that using just wx.Display().GetGeometry().GetSize() could be enough for setting the size of the main window. (I went from the fact that also other software I use always starts over the whole screen at the beginning), I think that making Single-Window smaller and saving the adapted extent into the User Settings does not make much sense... But we can let it as it is, I have no problem with that. I was just critically thinking about the code and if these 17 rows have some meaning.. |
@pesekon2 I have spent two hours thinking about how to suppress these GTK warnings when launching GRASS and no results. I just succeeded in making more of them :)... |
#3049 removes the stderr when GUI is started together with GRASS GIS (not for g.gui). |
@lindakladivova First thanks for your explanation. I attached my patch which solve two issues:
|
Tested on Gentoo with dwm with activated floating window mode and wxGUI has been launched maximized by default and custom user settings (win position and size) works as expected too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with multi-window and currently it ignores the map display size and position, because IsDocked
is True for mutli-window. This should fix it:
--- a/gui/wxpython/gui_core/preferences.py
+++ b/gui/wxpython/gui_core/preferences.py
@@ -1853,7 +1853,9 @@ class PreferencesDialog(PreferencesBaseDialog):
# window size must be larger than zero, not minimized
# do not save dim when mapdisp is docked within single window
- if not mapdisp.IsDocked() and (size[0] > 0 and size[1] > 0):
+ if (not mapdisp.IsDockable() or not mapdisp.IsDocked()) and (
+ size[0] > 0 and size[1] > 0
+ ):
dim += f",{pos[0]},{pos[1]},{size[0]},{size[1]}"
if single_window:
I tested multi-window with the patch above applied.
Windows appeared in original position, new position was ignored. It seems that there is still an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multi-window position is ignored
I have
in settings regardless how I organize windows. |
Strangely, when I change size of windows it works. But position is always the same:
|
|
a67fe98
to
bc9f85b
Compare
bc9f85b
to
f505365
Compare
Yep, that's unrelated (probably a wxPython 4.2.0 error). |
For me the position is saved as expected, I also use wxPython 4.2.0, so I am unsure why it doesn't work. |
Maximize or set dimensions from user settings.
In the interest of timely release I took liberty to merge and backport to 8_3 branch. |
Maximize or set dimensions from user settings.
Maximize or set dimensions from user settings.
Fixes #3013