Skip to content
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

Utility Window implementation. #3226

Merged
merged 5 commits into from
Nov 22, 2024
Merged

Conversation

gresm
Copy link
Contributor

@gresm gresm commented Nov 19, 2024

Adds pygame.window.Window(utility=True) which makes the window not appear in the taskbar (+pygame.window.Window.utility to get if this option is enabled for the window).
Note: SDL might not support this for all platforms (macOS?).

@gresm gresm requested a review from a team as a code owner November 19, 2024 12:01
@gresm gresm added enhancement window pygame.Window New API This pull request may need extra debate as it adds a new class or function to pygame labels Nov 19, 2024
docs/reST/ref/window.rst Outdated Show resolved Hide resolved
docs/reST/ref/window.rst Outdated Show resolved Hide resolved
@gresm gresm requested a review from damusss November 19, 2024 15:08
docs/reST/ref/window.rst Outdated Show resolved Hide resolved
Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nipicks and versionadded aside, I'd be happy to see this in. A week ago I actually needed this feature and ended up using ctypes to achieve it, it's like you read my mind.

@gresm gresm force-pushed the window-no-taskbar branch from aa92510 to 2733685 Compare November 19, 2024 15:22
@yunline
Copy link
Contributor

yunline commented Nov 20, 2024

Since SDL3 uses SDL_WINDOW_SKIP_TASKBAR as the flag, is it better to use skip_taskbar instead of utility as the name of the argument?
I think skip_taskbar is more clear than utility

@Starbuck5
Copy link
Member

Since SDL3 uses SDL_WINDOW_SKIP_TASKBAR as the flag, is it better to use skip_taskbar instead of utility as the name of the argument? I think skip_taskbar is more clear than utility

I love the way you're thinking but I think it's the other way around. SDL3 is utility, SDL2 is skip taskbar.

@gresm
Copy link
Contributor Author

gresm commented Nov 20, 2024

@yunline @Starbuck5 So, what's the decision?

@damusss
Copy link
Member

damusss commented Nov 20, 2024

So, what's the decision?

I wasn't asked, but I think it's best to follow sdl3. plus, utility is a bit more generic leaving "freedom of conceptual behaviour" to the OS. it just means the window is an utility, which usually results in no taskbar, but the OS can decide what utility means. I vote for utility. Btw you forgot to run py dev.py all

@ankith26
Copy link
Member

I also vote for leaving it as utility for reasons damus already mentioned, and also the fact that it the name SDL3 picked. Some setups don't have the taskbar at all, and SDL may still do something differently if utility is passed.

@yunline
Copy link
Contributor

yunline commented Nov 20, 2024

So, what's the decision?

SDL docs said: "window should be treated as a utility window, not showing in the task bar and window list".

From the docs we can see "utility window" is a broader concept than "skip taskbar window". They are not the same.

Some window environments don't have a task bar, they use window list

window list picture copied from somewhere of the internet

Some window environments use dock

macos-big-sur-dock.jpg

Although "skip_task_bar" could be more clear for Windows users, "utility" is more universal on all platforms.

So I vote for "utility".

@gresm
Copy link
Contributor Author

gresm commented Nov 20, 2024

Then it's utility.

@yunline yunline added the sdl3 label Nov 21, 2024
docs/reST/ref/window.rst Outdated Show resolved Hide resolved
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I would complain about adding new API that isn't cross platform, but in the case of Window I guess we already have enough API that isn't cross platform so it shouldn't be out of place.

Thanks for the PR! 🎉

@damusss damusss added this to the 2.5.3 milestone Nov 22, 2024
@damusss damusss merged commit 06cf5f3 into pygame-community:main Nov 22, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New API This pull request may need extra debate as it adds a new class or function to pygame sdl3 window pygame.Window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants