UI broken, possibly due to screen DPI #7

Open
opened 2024-01-14 22:08:16 +00:00 by stasiana · 5 comments

I use 4K screens on Debian 12. The UI shows poorly, with options off-screen. See the attachment.

I use 4K screens on Debian 12. The UI shows poorly, with options off-screen. See the attachment.
stasiana changed title from UI broken, possibly due to PDI to UI broken, possibly due to screen DPI 2024-01-14 22:08:47 +00:00
Owner

Thank you for your report! Are you able to test a patch if I send you one here?

Thank you for your report! Are you able to test a patch if I send you one here?
Author

Thank you for your report! Are you able to test a patch if I send you one here?

Sure thing.

> Thank you for your report! Are you able to test a patch if I send you one here? Sure thing.
Owner

What happens if you change this number:

--- a/plakativ.py
+++ b/plakativ.py
@@ -942,7 +942,7 @@ class VerticalScrolledFrame(tkinter.Frame):
             borderwidth=0,
             highlightthickness=0,
             yscrollcommand=vscrollbar.set,
-            width=240 * parent.winfo_fpixels("1i") / 96.0,
+            width=440 * parent.winfo_fpixels("1i") / 96.0,
         )
         canvas.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=tkinter.TRUE)
         vscrollbar.config(command=canvas.yview)

It would also be interesting to see what your system prints for this command:

python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))'

Thanks!

What happens if you change this number: ```patch --- a/plakativ.py +++ b/plakativ.py @@ -942,7 +942,7 @@ class VerticalScrolledFrame(tkinter.Frame): borderwidth=0, highlightthickness=0, yscrollcommand=vscrollbar.set, - width=240 * parent.winfo_fpixels("1i") / 96.0, + width=440 * parent.winfo_fpixels("1i") / 96.0, ) canvas.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=tkinter.TRUE) vscrollbar.config(command=canvas.yview) ``` It would also be interesting to see what your system prints for this command: python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))' Thanks!
Author

Great, that worked. Fatter bar makes all the options visible.

$ python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))'
96.0
Great, that worked. Fatter bar makes all the options visible. ``` $ python3 -c 'import tkinter; root = tkinter.Tk(); print(root.winfo_fpixels("1i"))' 96.0 ```
Owner

Okay, then we also have the culprit there. Tk thinks that your monitor dpi is 96 which is the same value that Tk presents for my monitor. If you have a 4k screen, that dpi value should probably be far larger. In that case, this is not a plakativ bug, but a bug in tk or elsewhere which feeds wrong data to plakativ which is using the dpi value to compute the correct size of the right-hand-side bar.

Okay, then we also have the culprit there. Tk thinks that your monitor dpi is 96 which is the same value that Tk presents for my monitor. If you have a 4k screen, that dpi value should probably be far larger. In that case, this is not a plakativ bug, but a bug in tk or elsewhere which feeds wrong data to plakativ which is using the dpi value to compute the correct size of the right-hand-side bar.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/plakativ#7
No description provided.