-
Notifications
You must be signed in to change notification settings - Fork 5
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
App doesn't redraw on unmaximize properly #103
Comments
I realized that, but I forgot to fix it before commiting. Fixing now... Thanks for reporting! |
Well, it iconifies and deiconifies, but it turns out thta on Windows 11, the expose function gets called about 25 times with the prev_state as zoomed (Probably due to te smooth animation that playes while unmaximizing) and the animations dont get disabled properley, so my entire PC became unusable due to TimerX maximizing and unmaximizing, then the expose function gets called again due to the window showing up again and I couldent even click end task on taskmanger so I literallay had to restart my pc |
Any idea on how to fix this? |
Uhh, stange. Try binding to Also, I updated the function (unindent the last line) because prev_state would have been updated only the first time the window was unmaximized (and not anymore), which could cause problems. def fullredraw(e):
global prev_state
if prev_state == "zoomed":
true_value = ctypes.c_int(1)
ctypes.windll.dwmapi.DwmSetWindowAttribute(app.wm_frame(), 3, ctypes.byref(true_value), ctypes.sizeof(true_value))
app.iconify()
app.deiconify()
false_value = ctypes.c_int(0)
ctypes.windll.dwmapi.DwmSetWindowAttribute(app.wm_frame(), 3, ctypes.byref(false_value), ctypes.sizeof(false_value))
prev_state = app.state() |
Yeah, I also did that, will try soon |
Configure does not work either, it just keeps maximizing and unmaximizing |
What if you could control the minimum number of resizes? Maybe only once or twice, nothing more. |
@sumeshir26 i see, you copied this part from Tukaan, but did you ever test it? (No). This code won't work as it is.
TimerX/main.py
Lines 62 to 69 in f1a8375
tkinter.Tk
(app
in this case) doesn't have neither_dwm_set_window_attribute
,DWMWA_TRANSITIONS_FORCEDISABLED
,minimize
norrestore
attribute.In tkinter you should use
iconify
instead ofminimize
anddeiconify
instead ofrestore
.Instead of
_dwm_set_window_attribute
andDWMWA_TRANSITIONS_FORCEDISABLED
you can use these two snippets:So the full function should look like this:
The text was updated successfully, but these errors were encountered: