-
-
Notifications
You must be signed in to change notification settings - Fork 145
Fixed bug: Flickering UI on canvas #127 #1150
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
base: 0.10
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import logging | ||
| import warnings | ||
| import wx | ||
| import sys | ||
| from typing import Callable, TYPE_CHECKING, Any, Generator, Optional | ||
| from types import GeneratorType | ||
| from threading import RLock, Thread | ||
|
|
@@ -163,8 +164,18 @@ def __init__(self, parent: wx.Window, world: "BaseLevel"): | |
|
|
||
| def _init_opengl(self): | ||
| super()._init_opengl() | ||
| self._file_panel = FilePanel(self) | ||
| self._canvas_sizer.Add(self._file_panel, 0, wx.EXPAND, 0) | ||
| if sys.platform == "linux": | ||
| self.panel = wx.Panel(self, style=wx.STAY_ON_TOP) | ||
| self.button_sizer = wx.BoxSizer(wx.HORIZONTAL) | ||
| self.button_sizer.AddStretchSpacer(1) | ||
| self.button_sizer.Add(self.panel, 0, wx.EXPAND, 0) | ||
| self._file_panel = FilePanel(self, self.panel) | ||
| self.panel.SetSizer(self._file_panel) | ||
| self.panel.SetBackgroundColour((155, 178, 216, 255)) | ||
| self._canvas_sizer.Add(self.button_sizer, 0, wx.EXPAND, 0) | ||
| else: | ||
| self._file_panel = FilePanel(self, self) | ||
| self._canvas_sizer.Add(self._file_panel, 0, wx.EXPAND, 0) | ||
|
Comment on lines
+167
to
+178
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue exists on macos as well. Your check only applies the custom behaviour to linux.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer this as well in the long run, but this was a quick way to keep the same windows behavior while making the linux side usable again. The 2 switches on sys.platform I had to use were:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay I understand |
||
| self._tool_sizer = ToolManagerSizer(self) | ||
| self._canvas_sizer.Add(self._tool_sizer, 1, wx.EXPAND, 0) | ||
|
|
||
|
|
||
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 would prefer one consistent behaviour across all platforms.
Does the wx.Window behaviour work across all platforms?
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.
It seems to not work correctly on Windows. Similar (though different) flickering behavior occurs when trying to use the Linux solution on Windows.