AltSnap icon indicating copy to clipboard operation
AltSnap copied to clipboard

Add a mark to the top windows,

Open calmwaves111 opened this issue 2 years ago β€’ 26 comments

Add a mark to the top windows, similar to deskpins. Add a pushpin to the top windows, so that you can intuitively know which windows are topped

calmwaves111 avatar Apr 21 '22 14:04 calmwaves111

related to #90 I understand your concern but actually I am not really willing to do this because it would require AltSnap to be much more intrusive as it would have to inject drawing code inside other programs which is unsafe unless I was 100% sure there are no bugs in my code.

Maybe I will do this in the future or maybe I will find a non-invasive trick. I will keep this issue opened so that other can see and comment on it.

RamonUnch avatar Jun 05 '22 09:06 RamonUnch

This would be a nice feature to have. It's currently difficult to know if a window has always on top activated. The context menu item(Action menu) should also have a checkmark when the option is activated.

Maybe have a border around the window like how powertoys alwaysontop utility does it.

rp1231 avatar Jul 13 '22 16:07 rp1231

The context menu item(Action menu) should also have a checkmark when the option is activated.

I agree, This is an easy one.

Maybe have a border around the window like how powertoys alwaysontop utility does it.

I will investigate How PowerToys makes this

RamonUnch avatar Jul 13 '22 19:07 RamonUnch

Hi @RamonUnch. πŸ‘‹ Thank you for developing AltSnap!

Add a mark to the top windows, similar to deskpins. Add a pushpin to the top windows, so that you can intuitively know which windows are topped

You might want to take a look at pinwin 's source code. This is exactly what it does.

xan2622 avatar Jul 14 '22 03:07 xan2622

Is the window border still a won't fix? If not I would like to add a feature request, It would be nice to have a keyboard shortcut as well to activate the on top. So that I can switch completely from powertoys on top.

Other wise I would have to keep powertoys on top running for the keyboard shortcut and I don't know if the borders of both these applications would interact with each other well.......

rp1231 avatar Jul 29 '22 18:07 rp1231

Is the window border still a won't fix?

For now it is still a won't fix, or at least not soon. Implementing a keyboard only shortcut is another story as it would not require to inject code into other processes.

RamonUnch avatar Jul 30 '22 14:07 RamonUnch

Similar to deskpins, there is a prompt in the title bar, I am looking forward to this function, otherwise I don't know if this window is on top。

meihus avatar Aug 10 '22 07:08 meihus

I would like to suggest a solution which is a compromise. It involves using AltSnap along with the Powertoys AlwaysOnTop.

There could be an advanced option in the .ini which allows you to send a hotkey instead when you select the always on top action from the action menu.

That hotkey will be the hotkey to activate the Powertoys Alwaysontop.

That way AltSnap users can use it in combination with Powertoys Alwaysontop and get their always on top windows marked.

Would that be possible?

rp1231 avatar Aug 11 '22 15:08 rp1231

This would not be hard to implement indeed quite an ugly mess however.

I will eventually add the option to make a custom action that just sends a key sequence so it will become a thing automatically.

What is the problem with PowerToys' AlwaysOnTop activation method? does it only support a keyboard shortcut? How are PinWin or PowerToys' AlwaysOnTop unable to fulfill your requirements on the only feature they are supposed to implement?

RamonUnch avatar Aug 11 '22 15:08 RamonUnch

What is the problem with PowerToys' AlwaysOnTop activation method? does it only support a keyboard shortcut? How are PinWin or PowerToys' AlwaysOnTop unable to fulfill your requirements on the only feature they are supposed to implement?

I quite like the PoweToys' AlwaysOnTop and the way it marks on top windows, but it only has the keyboard shortcut to activate it. There is no mouse only way to access it..... I like the altsnap action menu as it allows me to access the always on top functionality as well as the host of other options.

The pinwin method of selecting a window from a menu isn't really the most user friendly, at least for me personally. Especially if you use a lot of windows. And it too doesn't show any sort of visual indication that the window is in always on top mode.

rp1231 avatar Aug 11 '22 15:08 rp1231

I think this could be submitted as a feature request to both of them.

Also you may be interested in the eXtra Buttons, that also has a topmost option http://www.xtrabuttons.com/

The good thing about this topmosty option is also that it properly toggled when when you topmost/lower the window, with AltSnap.

RamonUnch avatar Aug 11 '22 17:08 RamonUnch

I would like to suggest a solution which is a compromise. It involves using AltSnap along with the Powertoys AlwaysOnTop. There could be an advanced option in the .ini which allows you to send a hotkey instead when you select the always on top action from the action menu. That hotkey will be the hotkey to activate the Powertoys Alwaysontop. That way AltSnap users can use it in combination with Powertoys Alwaysontop and get their always on top windows marked. Would that be possible?

Your solution relies on using another third party utility : PowerToys. 🀨 But not everyone uses it.

I quite like the PoweToys' AlwaysOnTop and the way it marks on top windows

I did understand that you suggested to use PowerToys AlwaysOnTop alongside AltSnap because of the way PowerToys AlwaysOnTop makes "windows on top" visible with the colored borders (which is a nice way to show it, I don't deny it). Another nice way to show it, IMO, as I suggested earlier, is to add a "pin icon" πŸ“ on the titlebar when AltSnap makes the window always on top.

AltSnap can already make windows always on top thanks to a hotkey (ALT + a mouse button). Altsnap just needs to visually show that a window is always on top, that being with a colored border or thanks to a pin icon. I would be happy with either each solution.

The pinwin method of selecting a window from a menu isn't really the most user friendly

That's not how pinwin works. To make a window always on top with it, you just have to click on the pinwin icon in the taskbar then click on the targeted window. That's all. Btw, if I suggested RamonUnch to take a look at pinwin's source code, it's just in case he wanted to reuse the code that adds a pin icon onto the titlebar, not the way pinwin manages to make windows always on top.

xan2622 avatar Aug 11 '22 17:08 xan2622

I think this could be submitted as a feature request to both of them.

I had submitted a feature request to powertoys to include a gui option. This was before I found out about altdrag/altsnap. But Powertoys is a has a lot of features and products and devs working on it. So there's no telling if/when it might actually get implemented.

Also you may be interested in the eXtra Buttons, that also has a topmost option http://www.xtrabuttons.com/

Yep but I'm happy with the action menu in altsnap and a window border for topmost window is the only feature I need along with keyboard shortcut. I've also come to appreciate that it doesn't inject anything into the windows. Altsnap works great for me at the moment and I don't want to add another software. I use powertoys anyways, so it doesn't matter to me if the alwaysontop is running in that, as I don't have to install anything extra.

The good thing about this topmosty option is also that it properly toggled when when you topmost/lower the window, with AltSnap.

Even the powertoys' alwaysontop shortcut gets properly toggled with altsnap. Plus the main feature I like from powertoys alwaysontop is the window border, which this doesn't have.

rp1231 avatar Aug 11 '22 17:08 rp1231

@xan2622 My solution doesn't rely on powertoys. It just adds the option to send a keyboard shortcut via the action menu.

So you are free to use any other application that supports keyboard shortcuts (including pinwin- if it supports keyboard shortcuts)

Powertoys was just used as an example.

rp1231 avatar Aug 11 '22 17:08 rp1231

What about this suggestion:

  • RamonUnch finds a way to implement colored borders for windows that are always on top.
  • And he adds the possibility, in the AltSnap.ini file, to type an extra keyboard hotkey (for example, Win+Ctrl+T) to toggle the always on top . This way, there would be two hotkeys to toggle it, a mouse shortcut and a keyboard shortcut.

xan2622 avatar Aug 11 '22 17:08 xan2622

Yep that was the suggestion initially, and the most ideal one. But there is the issue of the injected code which he doesn't want to add to altsnap (for security reasons). And that might take time to figure out.

The keyboard shortcut solution would be the quickest and easiest to implement with the most flexibility (As it allows everyone to have whatever sort of marking they want - window border or pin)

rp1231 avatar Aug 11 '22 18:08 rp1231

I am not a developer so please excuse my ignorance: Adding a colored border to a window or adding a pin to the titlebar necessarily requires to "inject code" ? If it does, does that mean that both PowerToys and PinWin "inject code" ?

xan2622 avatar Aug 11 '22 18:08 xan2622

I'm not a developer either but I do have some basic coding knowledge. I know that adding a pin on the titlebar requires injecting code which is why Ramon doesn't want to use this method. Regarding the colored border, I am not sure. Ramon would be the best person to clarify that.

rp1231 avatar Aug 11 '22 18:08 rp1231

In all cases they use or code injection or dirty hacks.

I realize that this feature actually has quite some importance, and alternative software are not good enough. I am working on an implementation, it is not perfect but at least it will get the job done. and it will just be a few tens extra lines of code and not a a huge megabyte project.

RamonUnch avatar Aug 12 '22 09:08 RamonUnch

here we go: set TopmostIndicator=1 in the [Advanced] section of the .ini file You can also set the PinRate value in milliseconds between two position refresh. Default is 32. larger values will give better performances, but less reactive pin position. The pin is not a pin but just a simple square.

It will not work perfectly with monitors that have different DPI settings, but I am working on it.I will need feedback because I have no more Win10 machines and I have no powerful enough PC to run it in a VM of any kind.

in the [Advanced] section
TopmostIndicator=1
PinRate=32

in the [Input] section
PinColor=FF FF 00
; FF FF 00 = Yellow
; FF 00 00 = Red
; 00 FF 00 = Green
; etc.

AltSnap1.55test26_x64.zip AltSnap1.55test26_i386.zip

I am actually not sure it will work at all on Win10 for now...

RamonUnch avatar Aug 12 '22 13:08 RamonUnch

Works, even with borderless windows, elevated ones and without button box. alwaysOntop

The only exception I found this early is the ApplicationFrameWindow class.

Ichisich avatar Aug 12 '22 14:08 Ichisich

Here on Windows 11 it works too: ShareX_bzhX1HD6Jm

xan2622 avatar Aug 12 '22 14:08 xan2622

Well I am glad to see that!

I will make some more efforts for per-monitor DPI setup, it should not be hard.

RamonUnch avatar Aug 12 '22 14:08 RamonUnch

Also if you left-click the indicator, it will disappear and remove topmost attribute. If you disable AltSnap it will also remove all indicators and the associated topmost attributes. This might ba an annoyance if you often enable/disable AltSnap via the tray icon. However I prefer to keep it this way (would be annoying to change). You can use the ScrollLock key to suspend/resume AltSnap and not have this problem.

RamonUnch avatar Aug 12 '22 14:08 RamonUnch

It works for me as well. Thanks

rp1231 avatar Aug 12 '22 15:08 rp1231

Well this version also adds a context menu of all topmost windows when you right click the indicator. I thought thiw would make sense, it just takes 5 extra lines of code. Image2

AltSnap1.55test27_i386.zip AltSnap1.55test27_x64.zip

RamonUnch avatar Aug 12 '22 17:08 RamonUnch

@irrealizable does it work for you?

Again small improvements, it now displays a T in the indicator (I think it looks beter like this). Also the option is available via the GUI.

AltSnap1.55test28_x64.zip AltSnap1.55test28_i386.zip

@xzayn, You asked for this AltSnap feature some time ago in Issue #90, I guess you would be interested in this build.

RamonUnch avatar Aug 13 '22 14:08 RamonUnch

Thank you RamonUnch for all that you've done regarding this feature request. It works very well. πŸ‘ I kind of prefered the colored rectangle without the " T ", but I guess it's just a matter of UI design preference. πŸ™‚

xan2622 avatar Aug 13 '22 16:08 xan2622

I think I will make the letter configurable, should be trivial, there are no reasons to force it anyway, as you say.

RamonUnch avatar Aug 13 '22 16:08 RamonUnch

I have just tested AltSnap 1.55 and if I am glad there's an option to display the colored rectangle (the indicator) on the titlebar, I think that this checkbox should be ticked βœ… (enabled) by default.

hjkghk

On a side note, notice how the line "Show an indicator on always on top windows" (at the bottom) is a bit truncated. My resolution is 3840x2160 with 125% DPI scale.

xan2622 avatar Aug 20 '22 12:08 xan2622