awakened-poe-trade icon indicating copy to clipboard operation
awakened-poe-trade copied to clipboard

Always on top doesn't work for some reason.

Open Conusoid opened this issue 3 years ago • 29 comments

After updating to 2.14.1 keeps appearing behind the game window (whether it's windowed or fullscreen windowed). Clicking on the window doesn't fix it. Arch linux, i3wm, picom.

Conusoid avatar Oct 24 '21 16:10 Conusoid

Same issue here with KDE Plasma. We seem to need the previous way of handling the overlay as a child. Always on top doesn't seem to work on Linux with our configurations.

thorsten-passfeld avatar Oct 24 '21 19:10 thorsten-passfeld

Indeed. Is there a way to downgrade in the meantime?

Xandaros avatar Oct 24 '21 19:10 Xandaros

Not working KDE here either. Arch Linux.

@Xandaros to downgrade, delete the .config/awakened-poe-trade directory. I wasn't able to get the older version to start without deleting it.

ahowell8 avatar Oct 24 '21 21:10 ahowell8

for i3 for_window [class="awakened-poe-trade"] floating enable

image


Awakened switched behavior to always on top, so it's the same for all OS and uses Electron API. Previous behavior was a hack and not possible to use on macos at all.

https://github.com/SnosMe/electron-overlay-window/blob/a6cfc1810af6b61f29c04729b53e2070249e0e64/src/index.ts#L74

SnosMe avatar Oct 24 '21 22:10 SnosMe

Thank you all, I confirm that the issue in i3wm was solved by adding floating mode to APT window class.

Conusoid avatar Oct 24 '21 22:10 Conusoid

The open-and-close is only necessary for me, when POE is in tiling mode. Setting it to windowed-fullscreen and setting it as floating appears to fix that issue. As far as I can tell, APT works just like on Windows now

Xandaros avatar Oct 24 '21 22:10 Xandaros

The open-and-close is only necessary for me, when POE is in tiling mode. Setting it to windowed-fullscreen and setting it as floating appears to fix that issue. As far as I can tell, APT works just like on Windows now

After setting APT to floating, I solved part of the issue. I then ended up with the open-and-close issue you mentioned. I followed your advice, and indeed focus is not stolen anymore after moving focus out and then back to the poe window. However, APT doesn't seem to be able to get focus at all anymore.
For example, if I price-check something, the price-check window doesn't come on top of the game. I have to manually open the overlay to see it.
It otherwise seems to work great and never steal focus anymore.

Any idea of what might be causing this behavior?

ktzee avatar Oct 25 '21 08:10 ktzee

I have the same problem on xmonad. Just a window (showing my wallpaper through poe) on top of the game.

weidtn avatar Oct 25 '21 09:10 weidtn

Same issue here with KDE Plasma. We seem to need the previous way of handling the overlay as a child. Always on top doesn't seem to work on Linux with our configurations.

You can create a rule for awakened-poe-trade in "system settings>window management>window rules" and force the window type to "on screen display" to fix this problem.

wofferl avatar Oct 25 '21 11:10 wofferl

Same issue here with KDE Plasma. We seem to need the previous way of handling the overlay as a child. Always on top doesn't seem to work on Linux with our configurations.

You can create a rule for awakened-poe-trade in "system settings>window management>window rules" and force the window type to "on screen display" to fix this problem.

Sadly I don't have the "on screen display" option in the dropdown menu.

thorsten-passfeld avatar Oct 25 '21 15:10 thorsten-passfeld

Is there a way to fix this under kwin? I'd rather not use another window manager if I can avoid it.

DaKingof avatar Oct 25 '21 23:10 DaKingof

,className =? "awakened-poe-trade" --> doFloat makes the window transparent in Xmonad, but no shortcuts (except Shift+Space) work anymore.

weidtn avatar Oct 26 '21 12:10 weidtn

Is there a way to fix this under kwin? I'd rather not use another window manager if I can avoid it.

downgrade to version 2.13.1 fix it for me, but need to freeze the app with chattr: cd ~;rm -rf ~/.config/awakened-poe-trade/; wget https://github.com/SnosMe/awakened-poe-trade/releases/download/v2.13.1/Awakened-PoE-Trade-2.13.1.AppImage; chmod +x Awakened-PoE-Trade-2.13.1.AppImage; sudo chattr +i Awakened-PoE-Trade-2.13.1.AppImage; ./Awakened-PoE-Trade-2.13.1.AppImage

dvastazion avatar Oct 30 '21 10:10 dvastazion

I know you posted the issue on linux but it's happening on windows os too but I think I found a temp solution for it. I disabled hardware acceleration in the settings tab and restarted. Now it works. So I hope that helps.

hardware_acc_disabled

Cilantr0 avatar Oct 30 '21 18:10 Cilantr0

I know you posted the issue on linux but it's happening on windows os too but I think I found a temp solution for it. I disabled hardware acceleration in the settings tab and restarted. Now it works. So I hope that helps.

yeah, this won't help on Linux. We need hw accel enabled for the window to be made transparent.

ktzee avatar Nov 01 '21 15:11 ktzee

We need hw accel enabled for the window to be made transparent.

It works fine w/o hw accel in i3wm, though I'm using picom compositor for the window to be transparent.

Conusoid avatar Nov 01 '21 15:11 Conusoid

We need hw accel enabled for the window to be made transparent.

It works fine w/o hw accel in i3wm, though I'm using picom compositor for the window to be transparent.

Did you configure picom some way specific? I use i3+picom too, and without hw accel, the overlay is solid black.

ktzee avatar Nov 01 '21 15:11 ktzee

Did you configure picom some way specific? I use i3+picom too, and without hw accel, the overlay is solid black.

Had same issue with backend = 'glx' in picom config (setting 'glx' solved screen tearing issue for me), so I've changed it back to default backend = 'xrender'.

Conusoid avatar Nov 01 '21 16:11 Conusoid

Yeah, I just checked and even without hw accel, it's not solid black anymore. It definitely used to be. Something has changed in the way this is rendered. However, even with hw accell off, initiating a price check (ctrl+D) does not bring the window in the foreground. I still need to manually open the overlay. Ctrl+Alt+D, instead, brings it to the foreground.

ktzee avatar Nov 01 '21 16:11 ktzee

How about something like "open in browser" hotkey, i think that feature would be nice. Should work the same as clicking on "Open in browser" button.

cf8 avatar Nov 18 '21 17:11 cf8

@cf8 no, https://github.com/SnosMe/awakened-poe-trade/issues/116#issuecomment-702395635

SnosMe avatar Nov 18 '21 18:11 SnosMe

@thorsten-passfeld

I had the same issue with KDE Plasma X11, forcing the window to be overlay fixed the issue:

5urAnN.png

It works in Windowed mode but not Windowed Fullscreen, where APT shows as a black box in the middle of the screen.

eclipseo avatar Mar 05 '22 00:03 eclipseo

On Screen Display on KDE didn't work for me, but setting "Focus protection" property to "None" seemed to fix the issue.

Gachick avatar Jun 09 '22 18:06 Gachick

Using i3/sway I always had an issue with the overlay soaking up the keyboard presses (though mouse input reached the game) while poe-trade was floating on the same workspace as PoE. For me the most robust solution was to just have poe-trade as a window on my secondary monitor, however, whenever the game loses focus (for example when checking trade in web browser), the window closes and i'll have to move the window back each time the game is refocused

for_window [class="awakened-poe-trade"] move container $ws15 only works the first time poe trade window opens (i.e. first exec of poe-trade + first focus gain of PoE)

I'm wondering if it would be possible to have an "always open/windowed mode" option checkbox. I could maybe also hack this myself, though if you could point me in the right direction (source files relevant to overlay opening/closing), that would be greatly appreciated.

LuyeT avatar Feb 18 '23 11:02 LuyeT

@LuyeT this mode is tracked in #803

SnosMe avatar Feb 18 '23 11:02 SnosMe

thanks, don't know how i missed that one while searching for it

LuyeT avatar Feb 18 '23 11:02 LuyeT

FOR KDE : These are my settings, seems to work! image E : I need to press the X to get the trading window off the screen. E : Seems to work only in windowed mode, I can live with that. Would prefer borderless, but focus seems to be needed for that, and other than that I can't cast shit if I remove "Accept Focus"

liperium avatar Apr 23 '23 14:04 liperium

Hey, I have the same problem In Arch/Gnome. When I do a price check a click does not make the keyboard focus back to the game. Is there Window Rules on Gnome?

Xenorage avatar May 20 '23 06:05 Xenorage

Hello there, I don't know if it's right place but I had a lot of troubles to make awakened-poe-trade work on awesomewm but after something like 10-12h of fighting I made it work flawlessly, so I am giving...

The Solution

Note: I play games in workspace with floating layout and with that it works for me ^^

picom.conf

In picom if you have set unredir-if-possible = true you must exclude poe from it:

unredir-if-possible-exclude = ["class_g = 'awakened-poe-trade'", "class_g='steam_app_238960'"]

Unfortunately it can give some penalty to performance, if you don't want vsync you must disable it in picom and in game. Also add APT to shadow-exclude or you can see some black little line on top of poe:

shadow-exclude = ["class_g = 'awakened-poe-trade'",];

awesome/rc.lua

At the bottom of rules add this:

    {
        rule_any = {
            class = {
                "awakened-poe-trade"
            }
        },
        properties = {
            border_width = 0,
            titlebars_enabled = false,
            focus = false,
            ontop = true
        }
    }

Also add to function body client.connect_signal("manage", function (c) this:

    if c.class == "awakened-poe-trade" then
        gears.timer.delayed_call(function()
            c.ontop = true
        end)
    end

After that all shortcuts should work including CTRL+D but if that's not the case add also in rc.lua

client.connect_signal("property::ontop", function(c)
    if c.class == "awakened-poe-trade" and not c.ontop then
        gears.timer.delayed_call(function() c.ontop = true end)
    end
end)

Update: if you have sloppy focus enabled, you must exclude APT from it:

--Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
    if c.class == "awakened-poe-trade" then
        return
    end

    c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)

And now it should work almost flawlessly, without needing to click 2x SHIFT+SPACE to make game working, CTRL+D working, it works as it works on Windows. Sometimes although you must click 2x SHIFT+SPACE to make CTRL+D working if you're switching focus but it happens rarely and it's hard to reproduce to further solve it.

Here's my awesomewm and picom config for this fix (ignore i3, it's not working there correctly)

On other WM you must just force APT to be always on top and to not gain focus on spawn and propably make sure it's floating. I guess. And of course disable borders, titlebars and stuff.

Explanation

APT worked very poorly for me, I had to slam SHIFT+SPACE 'til I could play normally. So I decided to notify every time new window is focused and I saw that it just looped "APT focus", "PoE focus", "APT focus", "PoE focus" etc. Then with more digging I realized that when APT window is spawned PoE loses focus, in response APT window destroys itself coz PoE lost focus and APT wasn't activated by user, PoE gains focus, APT creates window and it loops. So we need to make sure that APT start unfocused, hence one of our rules:

focus = false

Unfortunately CTRL+D was still not working and I had to press 3x SHIFT+SPACE to make settings appear. I realized that the first time I clicked SHIFT+SPACE or CTRL+ALT+D on item APT window was spawned below Path of Exile, then second SHIFT+SPACE closed it and the next spawned it finally above Path of Exile. So I added this rule:

ontop = true

But it didn't work. Something like 2h of digging and I found out that yeah, when window is spawned it is set on top BUT after that APT disable ontop xD -> here and here

I don't really know why this line doesn't bring it to top, I don't know electron that much. Anyways with that knowledge the solution is simple - I just need to force APT to be always on top. So I added delayed call to manage, so after APT window is created it just set ontop on true again. But I guess it's not working perfectly so I added also listener, if property ontop on APT window is changed to false, I just change it to true again.

And with that and of course disabling borders and titlebars, APT works almost perfectly on awesomewm. CTRL+D works, CTRL+ALT+D works, Shift+Space works UwU

PS. I love FOSS and ability to look at the source code of a program :heart:

ScuroGuardiano avatar May 29 '23 03:05 ScuroGuardiano