window border #112

Closed
opened 2026-01-05 14:48:23 +01:00 by adam · 7 comments
Owner

Originally created by @es183923 on GitHub (Jul 15, 2022).

Originally assigned to: @LGUG2Z on GitHub.

it would be really nice to have a window border feature, where it can help distinguish between the active and inactive windows. Currently, its not very easy to see which window is active, as there is no standard way of distinguishing between them.

Take VSCode for example. there is no difference in the window when it is active or inactive, and most apps just have the window manage buttons (minimize, maximize, close buttons) slightly dim, and you cant immediately tell.

Having a window border (with rounded corners as an option) would really help fix this.

It can also be used to distinguish if a window is float, etc

Originally created by @es183923 on GitHub (Jul 15, 2022). Originally assigned to: @LGUG2Z on GitHub. it would be really nice to have a window border feature, where it can help distinguish between the active and inactive windows. Currently, its not very easy to see which window is active, as there is no standard way of distinguishing between them. Take VSCode for example. there is no difference in the window when it is active or inactive, and most apps just have the window manage buttons (minimize, maximize, close buttons) slightly dim, and you cant immediately tell. Having a window border (with rounded corners as an option) would really help fix this. It can also be used to distinguish if a window is float, etc
adam added the enhancement label 2026-01-05 14:48:23 +01:00
adam closed this issue 2026-01-05 14:48:24 +01:00
Author
Owner

@es183923 commented on GitHub (Jul 22, 2022):

PowerToys actually has this as part of the keeping a window topmost. It adds a border as well.

@es183923 commented on GitHub (Jul 22, 2022): PowerToys actually has this as part of the keeping a window topmost. It adds a border as well.
Author
Owner

@LGUG2Z commented on GitHub (Jul 22, 2022):

bf2a107d7d/src/modules/alwaysontop/AlwaysOnTop/FrameDrawer.cpp for ref, PowerToys uses the Direct2D API to draw a border directly

@LGUG2Z commented on GitHub (Jul 22, 2022): https://github.com/microsoft/PowerToys/blob/bf2a107d7d7b519b161d7a6bb96bb2e3c9cbe9a5/src/modules/alwaysontop/AlwaysOnTop/FrameDrawer.cpp for ref, PowerToys uses the Direct2D API to draw a border directly
Author
Owner

@LGUG2Z commented on GitHub (Jul 23, 2022):

https://github.com/microsoft/PowerToys/issues/19543

There is a pending issue for this on PowerToys; let's see if this gets prioritized in their backlog. I don't really want to work on this in komorebi because the Direct2D API looks like a nightmare to work with. 😅

@LGUG2Z commented on GitHub (Jul 23, 2022): https://github.com/microsoft/PowerToys/issues/19543 There is a pending issue for this on PowerToys; let's see if this gets prioritized in their backlog. I don't really want to work on this in `komorebi` because the Direct2D API looks like a nightmare to work with. 😅
Author
Owner

@LGUG2Z commented on GitHub (Jul 25, 2022):

Given that komorebi has a pretty cohesive overview of the desktop state at any given time, instead of going down the Direct2D route like PowerToys, I am currently trying to implement this with a single window stripped of all decorations that is kept at the bottom of the desktop Z-order which is redrawn in new positions whenever the appropriate WindowManagerEvents take place and SocketMessages are received.

It is still intermittently somewhat buggy and I have leaked a fair bit of unsafe code outside of the safe abstractions I usually write over the Win32 API in windows_api.rs, but it's possible to enable, disable and set colour on the border with komorebic:

Enable or disable the active window border

USAGE:
    komorebic.exe active-window-border <BOOLEAN_STATE>

ARGS:
    <BOOLEAN_STATE>    [possible values: enable, disable]

OPTIONS:
    -h, --help    Print help information
Set the colour for the active window border

USAGE:
    komorebic.exe active-window-border-colour <R> <G> <B>

ARGS:
    <R>    Red
    <G>    Green
    <B>    Blue

OPTIONS:
    -h, --help    Print help information

The traditional window shape is kept for Windows 10 and the rounded window shape is used for the border on Windows 11.

image

Prebuilt binaries for early access are available here and the feature/active-border branch can also be built from source.

I'm hoping to be able to merge this to the master branch here by the first week August at the latest. 🎉

@LGUG2Z commented on GitHub (Jul 25, 2022): Given that `komorebi` has a pretty cohesive overview of the desktop state at any given time, instead of going down the Direct2D route like PowerToys, I am currently trying to implement this with a single window stripped of all decorations that is kept at the bottom of the desktop Z-order which is redrawn in new positions whenever the appropriate `WindowManagerEvent`s take place and `SocketMessage`s are received. It is still intermittently somewhat buggy and I have leaked a fair bit of `unsafe` code outside of the safe abstractions I usually write over the Win32 API in `windows_api.rs`, but it's possible to enable, disable and set colour on the border with `komorebic`: ``` Enable or disable the active window border USAGE: komorebic.exe active-window-border <BOOLEAN_STATE> ARGS: <BOOLEAN_STATE> [possible values: enable, disable] OPTIONS: -h, --help Print help information ``` ``` Set the colour for the active window border USAGE: komorebic.exe active-window-border-colour <R> <G> <B> ARGS: <R> Red <G> Green <B> Blue OPTIONS: -h, --help Print help information ``` The traditional window shape is kept for Windows 10 and the rounded window shape is used for the border on Windows 11. ![image](https://user-images.githubusercontent.com/13164844/180690201-2b966249-156f-4bd5-8536-ddae0feea040.png) Prebuilt binaries for early access are available [here](https://github.com/LGUG3Z/komorebi-dev/actions/runs/2729512265) and the `feature/active-border` branch can also be built from source. I'm hoping to be able to merge this to the `master` branch here by the first week August at the latest. 🎉
Author
Owner

@es183923 commented on GitHub (Jul 26, 2022):

Suggestion: add an alpha value so your borders don't need to be fully opaque.

Also, having it implemented this way prevents having multiple borders, which was my original suggestion.
Borders for each window instead of just one allows for:

  • a border unfocused windows (just for looks)
  • a way to determine the state of the window (for some attributes, like topmost, or floating)
  • a way to show if a container is a stack or a single window
  • and probably a lot more
@es183923 commented on GitHub (Jul 26, 2022): Suggestion: add an `alpha` value so your borders don't need to be fully opaque. Also, having it implemented this way prevents having multiple borders, which was my original suggestion. Borders for each window instead of just one allows for: - a border unfocused windows (just for looks) - a way to determine the state of the window (for some attributes, like topmost, or floating) - a way to show if a container is a stack or a single window - and probably a lot more
Author
Owner

@LGUG2Z commented on GitHub (Jul 26, 2022):

Alpha sounds like a good idea, I'll take a stab at that later this week: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setlayeredwindowattributes?redirectedfrom=MSDN

Really good arguments in favour of having per-window borders that can be color coded. I would like to add this eventually after settling on the right abstraction for border creation and destruction, and association with visible windows.

@LGUG2Z commented on GitHub (Jul 26, 2022): Alpha sounds like a good idea, I'll take a stab at that later this week: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setlayeredwindowattributes?redirectedfrom=MSDN Really good arguments in favour of having per-window borders that can be color coded. I would like to add this eventually after settling on the right abstraction for border creation and destruction, and association with visible windows.
Author
Owner

@LGUG2Z commented on GitHub (Aug 8, 2022):

This is now out of early access and on the master branch; further work like borders for unfocused windows, different colours and alphas per window types will be tracked in dedicated tickets. 🎉

@LGUG2Z commented on GitHub (Aug 8, 2022): This is now out of early access and on the master branch; further work like borders for unfocused windows, different colours and alphas per window types will be tracked in dedicated tickets. 🎉
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#112