Giter VIP home page Giter VIP logo

centertaskbar's Introduction

CenterTaskbar

Gif


Archived

  • Windows 11 will not be supported. Underlying changes to the taskbar break the technique this program uses to center the icons so this solution no longer functions and since Windows 11 implements native centering there will be no updates to support Windows 11. I've swithced to using StartAllBack which offers way more features and cleaner animations. Archiving this project for record purposes and it will remain available to use

Features

  • Dynamic - works regardless of number of icons, DPI scaling grouping, size. All padding is calculated
  • Animated - resizes along with default windows animations
  • Performant - sleeps when no resizing taking place to 0% CPU usage
  • Multimonitor suppport
  • Vertical orientation support
  • Multiple DPI support

Usage

Run the program and let it run in the background. It uses Windows UIAutomation to monitor for position changes and calculate a new position to center the taskbar items.

Command Line Args

First command line argument sets the refresh rate in hertz during active icon changes. Default 60. Recommended to sync to your monitor refresh rate or higher. When no changes are being made program goes to sleep and awaits for events triggered by UIAutomation to restart the repositioning thread allowing it to drop to 0% CPU usage.

Specifically it will monitor for:

  • WindowOpenedEvent
  • WindowClosedEvent
  • AutomationPropertyChangedEvent: BoundingRectangleProperty
  • StructureChangedEvent

centertaskbar's People

Contributors

a9g-data-droid avatar mdhiggins avatar sitiom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

centertaskbar's Issues

its not center

I tried this tool, icons aren't centered. they move to right side of taskbar

Not refreshing on unplug/plug external monitor. Scan for screen is not triggered when monitor plug/unplug

Describe the bug
I have an external monitor conected to a HUB that connects to my pc thougth USB C. When unplug/plug the monitor , the icons are moved and dont refresh con new screen. Need to refresh manually

To Reproduce
Steps to reproduce the behavior:
1 . Unplug/or switch off monitor
2 . Desktop moves to laptor screen
3. Icons are not centered anymore (They are moved to the left/rigth, seems like position is not being recalculated since it's not the standar position either)
4. I look up for the app , and select the "Scan for screen"
5. Get fixed

Expected behavior
Scan for screen is triggered automatically when plug/unplug monitor

Screenshots
If applicable, add screenshots to help explain your problem.

A . Taskbar on notebook desktop after unplug monitor

image

B . Selecting "Scan for screen"
image

C. OK taskbar

image

Additional context
Thanks for the great up , really enjoying !

It doesn't work on Windows11.

Describe the bug
It doesn't work on Windows11.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to Windows11
  2. Open the software.
  3. And find it doesn't work.

Expected behavior
It works as it was on Windows 10.

Screenshots
Snipaste_2021-10-05_12-51-26

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: latest

Additional context
I know that windows 11 has provided central taskbar.
But the start icon is also moved to the center, that's not good.

didn't work

run the program, and nothing happen nothing changes, run as admin or not
v1.5, windows 10 20H2
屏幕截图 2020-10-29 144832

Doesn't sleep when I would expect no activity.

The readme states "sleeps when no resizing taking place to 0% CPU usage". However, you will notice it working often in the background when no changes to the taskbar are taking place. If you run it in debugging mode you will see there are a high volume of "WindowClosedEvent" that aren't visible. I must assume that the OS generates these events for smaller "Window" objects that don't have a taskbar icon. I have attempted to find a better way of detecting Taskbar object close events and I have not yet been able to do so.

I did notice that listening to "WindowOpenedEvent" is superfluous. The BoundingRectangleProperty catches new Taskbar items just fine without it. It does not catch objects leaving the taskbar.

We either need to filter WindowClosedEvent to only generate for taskbar items or find a different event that doesn't false fire so often.

Where is the Executable?

I seriously just can't find out which file I need to run because I've clicked on all of them, and they either open in vs code, notepad, or don't do anything.

Expected behavior
It would be easier to have a file that is clearly the executable.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 20H2

Smooth animation?

Hi,
for some reason the animation is not so smooth on my Windows 10 PC when a new app is opened. Is this a graphic limitation?

Publish the app to Microsoft Store

Microsoft Store is one place for everything in your life, moving your experience to a safe one and making it accessible from many devices that added to your Microsoft account.

Publishing apps to Microsoft Store is benefit both for users and developers + enterprise. Deploying classic apps, that available in Microsoft Store, with safe methods to a verified environments is trusted by enterprises and users. From the other hand, developer can benefit from "In-App Purchase" (paid features of the app), making its own Insider programs, setting up subscriptions and advertisements.

Microsoft corporation has opened a door to developers of classic apps, the way to publish your app to Microsoft Store. UWP brings a second life for your apps: notifications, full power of trusted UWP/WinRT API, easy debug, easy deploy, additional features.

Learn more about that easy process here.

Best regards,
Innokenty Ivanov,
North-Eastern Federal University student (PhD student).
Programmer, web developer, Microsoft Student Partner.
My e-mail.

Conflicts with application Snip & Sketch. Win+Shift+S not working.

Describe the bug
Conflicts with application Snip & Sketch. Win+Shift+S not working.

To Reproduce
Steps to reproduce the behavior:

  1. Start CenterTaskbar with windows
  2. try Win+Shift+S.

Expected behavior
Snip & Sketch should working.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 2004 19041.572

No longer working

Can't say why, but this has stopped working altogether in the latest releases. Using Windows 10 Pro 1909 18363.836.

Anyway to give any additional info?

Possible speed in Reboot?

I tried to set the executible files as a start up file, but i have to wait 1 minute before the application starts.
Is possible to do something about? Maybe using the process of windows?

Any plan to support for Windows 11?

Now windows 11 only have 2 option to set the start menu and the icons in center or left.
I think it would be awesome it we set the start menu in left and the app icon in the center.
What do you think?

Thanks.

Sometimes gets stuck

The taskbar sometimes doesn't move when new applications open and close. It doesn't just not work like in #8, but it's inconsistent.

I cannot consistently recreate the issue, but it's subtly jarring when it happens. I'll add more info as I have more time to work on it.

Problem when pressing shift keys

When you press either shift key, all taskbar icons forget their position and return to the far left of the taskbar for a brief moment. Is this possible to fix?

Toolbars are not positioned correctly

Describe the bug
Toolbars are not positioned correctly

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] windows 10 version 2004
  • Version [e.g. 22] 1.5

Additional context
The toolbar used is: NetSpeedMonitor and I have TranslucentTB running to make the taskbar transparent.

Unhandled exception System.NullReferenceException

Describe the bug
Unhandled exception leads to process termination

To Reproduce
Haven't found a way to reproduce it yet since this seems to randomly happen (I'll keep observing what causes this)

Desktop (please complete the following information):

  • OS: Windows 10 20h2
  • Version 1.6

Additional context
Started with parameter 144 for 144 Hertz display.

Event:
Application: CenterTaskbar.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
  at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
  at CenterTaskbar.TrayApplication.<Start>b__32_0(System.Windows.Automation.AutomationElement)
  at System.Threading.Tasks.Parallel+<>c__DisplayClass42_0`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<PartitionerForEachWorker>b__1()
  at System.Threading.Tasks.Task.InnerInvokeWithArg(System.Threading.Tasks.Task)
  at System.Threading.Tasks.Task+<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(System.Object)

Exception Info: System.AggregateException
  at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)
  at System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)
  at System.Threading.Tasks.Parallel.PartitionerForEachWorker[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Concurrent.Partitioner`1<System.__Canon>, System.Threading.Tasks.ParallelOptions, System.Action`1<System.__Canon>, System.Action`2<System.__Canon,System.Threading.Tasks.ParallelLoopState>, System.Action`3<System.__Canon,System.Threading.Tasks.ParallelLoopState,Int64>, System.Func`4<System.__Canon,System.Threading.Tasks.ParallelLoopState,System.__Canon,System.__Canon>, System.Func`5<System.__Canon,System.Threading.Tasks.ParallelLoopState,Int64,System.__Canon,System.__Canon>, System.Func`1<System.__Canon>, System.Action`1<System.__Canon>)
  at System.Threading.Tasks.Parallel.ForEachWorker[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Threading.Tasks.ParallelOptions, System.Action`1<System.__Canon>, System.Action`2<System.__Canon,System.Threading.Tasks.ParallelLoopState>, System.Action`3<System.__Canon,System.Threading.Tasks.ParallelLoopState,Int64>, System.Func`4<System.__Canon,System.Threading.Tasks.ParallelLoopState,System.__Canon,System.__Canon>, System.Func`5<System.__Canon,System.Threading.Tasks.ParallelLoopState,Int64,System.__Canon,System.__Canon>, System.Func`1<System.__Canon>, System.Action`1<System.__Canon>)
  at System.Threading.Tasks.Parallel.ForEach[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Action`1<System.__Canon>)
  at CenterTaskbar.TrayApplication.Start()
  at CenterTaskbar.TrayApplication..ctor(System.Collections.Generic.IReadOnlyList`1<System.String>)
  at CenterTaskbar.Program.Main(System.String[])

Когда закрываю ноутбук в сон, вылетает ошибка



************** Загруженные сборки **************
mscorlib
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3875.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
CenterTaskbar
    Версия сборки: 1.1.7713.26472
    Версия Win32: 1.1.7713.26472
    CodeBase: file:///C:/Users/Mikalai_si/Documents/CenterTaskbar.exe
----------------------------------------
System.Windows.Forms
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3830.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3640.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
UIAutomationClient
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationClient/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationClient.dll
----------------------------------------
UIAutomationTypes
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
----------------------------------------
UIAutomationProvider
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
WindowsBase
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System.Core
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
UIAutomationClientsideProviders
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3895.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationClientsideProviders/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationClientsideProviders.dll
----------------------------------------
Accessibility
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
mscorlib.resources
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_ru_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
UIAutomationClientsideProviders.resources
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationClientsideProviders.resources/v4.0_4.0.0.0_ru_31bf3856ad364e35/UIAutomationClientsideProviders.resources.dll
----------------------------------------
System.Configuration
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3630.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
UIAutomationTypes.resources
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes.resources/v4.0_4.0.0.0_ru_31bf3856ad364e35/UIAutomationTypes.resources.dll
----------------------------------------
System.Windows.Forms.resources
    Версия сборки: 4.0.0.0
    Версия Win32: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_ru_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Оперативная отладка (JIT) **************
Для подключения оперативной (JIT) отладки файл .config данного
приложения или компьютера (machine.config) должен иметь
значение jitDebugging, установленное в секции system.windows.forms.
Приложение также должно быть скомпилировано с включенной
отладкой.

Например:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

image

Resolution change bug

Program doesn't refresh after resolution changes forcing the user to do a manual scan of screen to re-center the icons.

Icons un-center when an app (dis)appears in the notification area

To Reproduce
Steps to reproduce the behavior:

  1. Start an application which adds an icon to the notification area (aka system tray), for example OBS Studio. The same happens if an app which has an icon in the notification area is closed.
  2. All icons pinned to taskbar move to the left. Most of the time they move back to Windows' default position (next to the Start Menu button), sometimes they are out of center with an offset to the left.
  3. A manual re-scan helps to center the icons.

Expected behavior
Optimal behavior: Application icons remain in center.
Minimum behavior: (Dis)appearing items in the notification area trigger a re-scan so that application icons re-center without any manual user action.

Desktop (please complete the following information):

  • OS: Windows 10 Pro 20H2
  • Version 1.92

TranslucentTB breaks multimonitor compatibility [Win10 20H1]

Describe the bug
Cannot center the taskbar on a new display in a multimonitor setup when running TranslucentTB

To Reproduce
Steps to reproduce the behavior:
Install TranslucentTB
(I am running it in Blur mode)
Plug in a second monitor, right click on tray icon, click scan for desktops. Icons do not center.
image
image

Icons are still perfectly centered on first (laptop) display.
image

Expected behavior
I expected the icons to center upon plugging in the new display, and especially upon clicking "scan for screens".

I don't expect compatibility as these are two different programs modifying the taskbar behaviour, but I would imagine that a fix may not be difficult. Having both programs running on my PC drastically improves the look and feel of Windows 10, and I would be ecstatic if a fix is possible.

The effect works if

  1. Kill TranslucentTB
  2. Click scan for desktop, other desktops will center
  3. Start TranslucentTB.

image

Desktop (please complete the following information):

  • Windows 10 20H1

Feature request

Could you please add an option to center these buttons too?

image

Command line arguments

Hi.
First of all — love this app! A must have for all ultrawide monitor owners.
Is there any way to set refresh rate without cmd so it stays after OS restart?

Center other elements of taskbar.

Is it possible to also center the windows icon and/or the date widget?
Then it would be very cool to also make the Taskbar transparent.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.