mirror of
https://github.com/1j01/textual-paint.git
synced 2024-09-11 15:56:03 +03:00
Fix Python rocket icon showing in dock on macOS after Set As Wallpaper
This commit is contained in:
parent
5c7272db91
commit
1c64fdb78c
@ -224,8 +224,6 @@ GNOME Terminal works best, with crisp triangles used for icons in dialogs, emoji
|
||||
|
||||
### macOS
|
||||
|
||||
For **Set As Wallpaper**, it works better if you install tkinter, with `brew install python-tk`, so it can use your monitor's resolution. (This dependency could be removed in the future.)
|
||||
|
||||
Tested on OSX 10.14 (Mojave), with iTerm2, and VS Code's integrated terminal.
|
||||
|
||||
iTerm2 mostly works, but two tool icons are missing (Free-Form Select and Fill With Color).
|
||||
|
@ -51,6 +51,7 @@
|
||||
"getpid",
|
||||
"getpixel",
|
||||
"goland",
|
||||
"gsettings",
|
||||
"gvim",
|
||||
"hackily",
|
||||
"Haha",
|
||||
@ -75,6 +76,7 @@
|
||||
"Nemo",
|
||||
"Noto",
|
||||
"Odhner",
|
||||
"osascript",
|
||||
"pagedown",
|
||||
"pageup",
|
||||
"palettized",
|
||||
@ -88,6 +90,7 @@
|
||||
"pycache",
|
||||
"pyfiglet",
|
||||
"Pylance",
|
||||
"pyobjc",
|
||||
"pyperclip",
|
||||
"pypixelart",
|
||||
"pyright",
|
||||
|
@ -1,4 +1,5 @@
|
||||
appscript==1.2.2; sys_platform == 'darwin'
|
||||
appscript==1.2.2; sys_platform == 'darwin' # for setting the wallpaper on macOS; optional, falls back to osascript CLI
|
||||
pyobjc-framework-Quartz==9.2; sys_platform == 'darwin' # for getting the screen resolution on macOS; optional, falls back to 1920x1080
|
||||
Pillow==9.5.0
|
||||
# psutil==5.9.0 # for cleaning up open files when auto-restarting on changes in development; optional
|
||||
pyfiglet==0.8.post1
|
||||
|
@ -11,6 +11,7 @@ import argparse
|
||||
import asyncio
|
||||
from enum import Enum
|
||||
from random import randint, random
|
||||
import sys
|
||||
from typing import Any, Coroutine, NamedTuple, Optional, Callable, Iterator
|
||||
from uuid import uuid4
|
||||
|
||||
@ -3604,6 +3605,19 @@ Columns: {len(palette) // 2}
|
||||
"""Get the screen size."""
|
||||
# TODO: test DPI scaling
|
||||
try:
|
||||
# special macOS handling to avoid a Python rocket icon bouncing in the dock
|
||||
# (with screeninfo module it bounced; with tkinter it didn't, but still it stayed there indefinitely)
|
||||
if sys.platform == "darwin":
|
||||
# from AppKit import NSScreen
|
||||
# screen = NSScreen.mainScreen() # Shows rocket icon in dock...
|
||||
# size = screen.frame().size.width, screen.frame().size.height
|
||||
# return size
|
||||
|
||||
from Quartz import CGDisplayBounds
|
||||
from Quartz import CGMainDisplayID
|
||||
main_monitor = CGDisplayBounds(CGMainDisplayID())
|
||||
return (int(main_monitor.size.width), int(main_monitor.size.height))
|
||||
|
||||
# from screeninfo import get_monitors
|
||||
# largest_area = 0
|
||||
# largest_monitor = None
|
||||
|
Loading…
Reference in New Issue
Block a user