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

How to allow windows to overlap though it is topmost window like widgets? #2377

Open
Sayad-Uddin-Tahsin opened this issue Apr 15, 2024 · 6 comments

Comments

@Sayad-Uddin-Tahsin
Copy link

I want to create a Windows 10 widget that stays on the desktop but doesn't overlap with other windows or disappear when I press Win + D or click the Desktop button. Basically, I want it to always be visible on the desktop, even if other applications are running but not overlap on any other Application's Interface. How can I do so?

@Akascape
Copy link

@Sayad-Uddin-Tahsin
Use this:
root.attributes("-topmost", True)

@Sayad-Uddin-Tahsin
Copy link
Author

@Sayad-Uddin-Tahsin Use this: root.attributes("-topmost", True)

but it makes my window to overlap other windows! I don’t want so, but I want it to not disappeare once desktop button is clicked! It will always there in the Desktop ( All minimized). I hope you understood

@Akascape
Copy link

@Sayad-Uddin-Tahsin Then simply use the overrideredirect method

root.overrideredirect()

@Sayad-Uddin-Tahsin
Copy link
Author

@Sayad-Uddin-Tahsin Then simply use the overrideredirect method

root.overrideredirect()

Using root.overrideredirect() also seems hides the windows on Desktop Button Press! Doesn’t it hide the top control bars? I am using it currently...

@Sayad-Uddin-Tahsin
Copy link
Author

@Akascape Do you know any way to just detect the Desktop Button Click? so that I can force_focus that on that event which will achieve the effect I'm looking for?

@Sayad-Uddin-Tahsin
Copy link
Author

@Akascape Seems using this method:

def unminimize(window: ctk.CTk):
    if not window.winfo_ismapped():
        window.state('withdrawn')
        window.state('normal')
        window.attributes("-topmost", True)
        window.attributes("-topmost", False)

root.bind("<Unmap>", lambda e: root.after(500, lambda: unminimize(root)))

does what I'm looking for but when using overrideredirect(True) doesn't work! Is there any way you know to bypass the issue or any way and achieve what I wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants