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

Add methods WindowHandle::is_resizable etc #2115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RagibHasin
Copy link

Add 3 methods to WindowHandle for querying if the window:

  1. is resizable,
  2. has title bar,
  3. is transparent.

At this moment only Windows and GTK+ backends are implemented and only Windows backend is tested locally.

I am not familiar with any backend except Windows so I don't see myself implementing these for the other backends.

These functionalities, especially transparency testing, are necessary for proper acrylic and mica background support on Windows through widgets.

Also, I anticipate that it would be also necessary for macOS translucent background if somebody implements it sometime.

Copy link
Contributor

@james-lawrence james-lawrence left a comment

Choose a reason for hiding this comment

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

slightly curious about the point of these method. mostly its querying state that the user of druid has manually set. hats the usecase?

druid-shell/src/backend/wayland/window.rs Outdated Show resolved Hide resolved
@RagibHasin
Copy link
Author

slightly curious about the point of these method. mostly its querying state that the user of druid has manually set. hats the usecase?

These methods are internally used by widgets to determine their behavior without explicitly repeating these info upon creating them.

RagibHasin added a commit to RagibHasin/druid that referenced this pull request Jan 8, 2022
@james-lawrence
Copy link
Contributor

james-lawrence commented Jan 8, 2022

@RagibHasin yes, that part was obvious. =) I was hoping for a couple actual usecases for these. resize for example I'd probably just react to lifecycle size events. and I'm struggling to come up with a usecase for is_transparent that isn't resolved just by setting the background of a widget to transparent.

not a big deal, primarily just curious.

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

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

Sorry for letting this wait so long.

Please do the following:

  • Rebase on master to resolve merge conflicts
  • Add a changelog entry to CHANGELOG.md

Once we pass the CI I will take a deeper look.

@xStrom xStrom added shell concerns the shell abstraction S-waiting-on-author waits for changes from the submitter labels Jan 12, 2023
@RagibHasin
Copy link
Author

Sorry for the late response myself. Have been busy with coursework.
Also, this is no longer a priority as the project I used this on is in limbo and I am eagerly awaiting for a usable version of xilem.
So, I wouldn't mind if this does not land in druid-shell 0.8.

However, should I see if this patch is also suitable for glazier and make a PR there?

@xStrom
Copy link
Member

xStrom commented Jan 22, 2023

Alright we'll let this sit a bit more then, as I am very busy with 0.8 work as it is.

The code changes are simple and would be a fast review, but the concerns of purpose brought up by @james-lawrence would need deeper thinking, which I'll postpone right now.

Regarding sticking with this PR here or making one for Glazier - it really comes down to what you yourself want. Glazier is without a doubt the future of druid-shell. However it is unknown if and when Druid will migrate from druid-shell to glazier. So if you want to, in practice, have these features in Druid - then keeping this PR here open would be the fastest way.

@xStrom xStrom added S-needs-review waits for review and removed S-waiting-on-author waits for changes from the submitter labels Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-review waits for review shell concerns the shell abstraction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants