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

Some placement issues with top taskbars #25

Open
Naamloos opened this issue Jan 17, 2022 · 16 comments
Open

Some placement issues with top taskbars #25

Naamloos opened this issue Jan 17, 2022 · 16 comments
Labels
enhancement New feature or request

Comments

@Naamloos
Copy link

Hi! I found this project because someone I follow starred this.

I've been working on a similar project, yet found this. I think this could potentially be a better project than mine, so I decided to write up a couple of issues I've noticed with top taskbars to potentially help you a bit along the way.

  1. Window thumbnails are rendered offscreen.
  2. Taskview is rendered at the bottom of the display
  3. Notifications and control panel are oriented from bottom-to-top when the taskbar is at the top

Some of these issues I've fixed in my own project. Following is some info that may help people potentially fixing it.

Window Thumbnail misplacement

When hovering a taskbar icon, the thumbnail is rendered above the taskbar. To fix this, I had my program poll every x milliseconds for the thumbnails window, and place it under the taskbar with the win32 call SetWindowPos. The thumbnails window's class name is TaskListThumbnailWnd. It's window title varies, but finding the window by class should work fine.

Taskview misplacement

The taskview has a similar issue to the thumbnail view, yet instead of getting rendered above the taskbar it gets rendered at the bottom of the screen (+ the taskbar height). Fixing this was done with a SetWindowPos call as well. It's window class is XamlExplorerHostIslandWindow. It's window title is empty.

Notifications and controlpanel view misplacement

I haven't found a fix for this yet. The notification view window has the same height as the display, even when the actual contents don't add up to that height. I haven't been able to calculate the actual height due to the actual window appearing to be XAML based.
The window classes for both is Windows.UI.Core.CoreWindow, with their window titles being Control Center and Notification Center respectively.

One small issue here is that these solutions require polling User32 APIs to find windows and their positions (and fix them).

In conclusion

I really want this to work, as I am extremely petty towards Microsoft's decision to lock the taskbar. Feel free to contact me if you want to discuss possible solutions :) (Discord Naamloos#2887)

By the way, my existing solution can be found here:
https://github.com/Naamloos/TopCenterStart11/blob/master/src/main.rs (it's a single source file, but it works.)

@Naamloos
Copy link
Author

Oh! also the taskbar isn't centered. It's window class is Windows.UI.Core.CoreWindow with window title Start. Fortunately this window's size can be configured safely. I'm fairly sure it's fixed to 666x750 pixels, including the padding (I'm dead serious, I calculated it). I'm not sure whether it differs per screen resolution.

@jetspiking jetspiking added the enhancement New feature or request label Jan 18, 2022
@jetspiking
Copy link
Owner

Hi there!

Thank you for your extensive reply. This sounds like a great solution for the thumbnail issue and the placement of the startmenu.

What is the issue with the Task View and notifications? I am not noticing any elements falling off sceen.

I will attempt to implement a fix for the thumbnail misplacement in the upcoming version, this is probably the most important issue with a top-aligned taskbar.

@jetspiking jetspiking pinned this issue Jan 18, 2022
@Naamloos
Copy link
Author

Naamloos commented Jan 18, 2022

Apologies in advance for the long comment

Here's the issues I've noticed with the task view and notifications in screenshots I've made before for my own application.

First off, in this image you can see the desktop preview for the task view is rendered at the bottom of the screen.
image

Second issue: when there are no notificiation the notification view is rendered from top-to-bottom. e.g. the calendar spawns at the bottom of the screen despite the taskbar being at the top. I haven't found a real fix for this yet as I've said before.
image

Lastly, the startmenu gets rendered where it would render if the start button is left-aligned, but it should align to the center as my start button is there.
image

Again, feel free to check my project for some inspiration for potential fixes. Polling seems required as the windows tend to jump back to their original positions.

@jetspiking
Copy link
Owner

Thank you for your reply! I think your solution for these issues works very well. I edited the readme to mention the prioritization of this issue in the upcoming release. Polling is not the most elegant solution. However, your implementation seemed very lightweight. I will attempt to configure the polling rate as low as possible, for minimum CPU-usage, without noticing the position change.

@Naamloos
Copy link
Author

Small suggestion, perhaps it would be an option to run these polling methods as a windows service?

https://docs.microsoft.com/en-us/dotnet/core/extensions/windows-service

@jetspiking
Copy link
Owner

jetspiking commented Jan 18, 2022

For a next release I hope to give the entire app support to keep it running in the background (and hide the taskbar icon). In the registry a path can be set to launch an application. A service could be prevented this way to keep this application as portable as possible. This was suggested in the following issue by @Euclidite.

#14

@jetspiking
Copy link
Owner

Due to Microsoft removing the registry tweak to place the taskbar in the top position (forced to bottom) for version 22533 and later the development of this feature has been halted, since I would like to find an alternative for setting the taskbar to the top position. Please view issue 23 for more details. I will tag @Naamloos GitHub's repository for a temporary solution for those who want to use the top-aligned preview windows for the time left on earlier versions. This is visible in issue 9.

Issue 9
Issue 23

@Naamloos
Copy link
Author

aw man

@Naamloos
Copy link
Author

time to find a hack?

@jetspiking
Copy link
Owner

I really have no idea if I can find a solution for this issue. The entire app was built around registry tweaks, I also did not really consider Microsoft removing them, without providing any alternative at all.

I wonder if the taskbar position can be manipulated in the same way as how you adjusted the preview window. I should play around a bit with the API.

@Naamloos
Copy link
Author

I'm 100% sure you can move around the Taskbar, but I can't say for sure whether full screen windows will adapt.

Actually, I might know a way..

@Naamloos
Copy link
Author

I'll try something later tonight, or tomorrow

@Naamloos
Copy link
Author

Considering almost everything in Windows UI is built of.. windows, I have a suspicion that the actual desktop area might also be a window. I'll see later today if I can figure out a hack that moves the taskbar without a dependence on the registry.

@Naamloos
Copy link
Author

With "desktop area" I mean the area controlling where windows can fill.

@Rush-er
Copy link

Rush-er commented Mar 11, 2022

Take a look here, i found this tool useful
https://github.com/valinet/ExplorerPatcher

@Naamloos
Copy link
Author

@jetspiking I released an update that fixes the registry hack being patched. (taskbar is now moved "manually").

Feel free to take a look at my code, but of course I'd personally prefer just linking back.
https://github.com/Naamloos/TopCenterStart11/releases/tag/2.0

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

No branches or pull requests

3 participants