Sway: Cursor doesn't show up when it should in Minecraft

Created on 6 Feb 2019  路  7Comments  路  Source: swaywm/sway

Sway version: sway version 1.0-beta.2-297-gaee99421 (Jan 31 2019, branch 'master')
Driver: xf86-video-ati

Sometimes the cursor doesn't show up when it should. Some action make it appear, some doesn't, it's quite odd. I was able to make the cursor reappear by moving the mouse away from the window and then focus it again.

How to reproduce

  1. Run Minecraft
  2. Load world
  3. Right click on chest or crafting table, menu opens but cursor doesn't show up

I did a debug log doing exactly this:

  1. Run Minecraft
  2. Load world
  3. Press "e" to open inventory, cursor show up correctly
  4. Press "esc" to open menu, cursor show up correctly
  5. Right click on chest, cursor doesn't show up
  6. Right click on crafting table, cursor doesn't show up
  7. Quit Minecraft
  8. Manually exit sway
    sway.log
bug

Most helpful comment

Can't reproduce anymore.

All 7 comments

I'm experiencing the same issue with Minecraft in Sway 1.0.8 running the amdgpu driver.

The strange thing about this is that the cursor does sometimes show up, when opening a chest or crafting bench (maybe every 1/30 attempts). I have yet to find a way to reproduce this reliably.
It is almost entirely random for me, but it feels like it has to hit a certain time frame to get the cursor to show and depending on the system load and lag in the game the cursor shows up or doesn't.

Aside from those rare exceptions, the behaviour is exactly as Nomeji described.
Is there any data that could be provided to help investigate this?

A WAYLAND_DEBUG=1 log might be helpful, but it'll likely be a huge amount of data to sift through. Also, if Minecraft runs through Xwayland (it probably does), you need to put the WAYLAND_DEBUG=1 on Xwayland itself.

Basically, it's possible that the Minecraft/Xwayland is telling us to hide the cursor and we're just doing what we're supposed to.

I've looked at a live log of the sway debug output and it appears that every time a GUI opens, the locked pointer constraint is destroyed as expected and a new one is created after the GUI is closed, as seen in Nomeji's log.

sway debug output:

2019-02-06 14:23:03 - [types/wlr_pointer_constraints_v1.c:238] new confined_pointer 0x564b178df770 (res 0x564b1784db80)
2019-02-06 14:23:03 - [types/wlr_pointer_constraints_v1.c:351] constrained 0x564b178df770
2019-02-06 14:23:03 - [types/wlr_pointer_constraints_v1.c:47] destroying constraint 0x564b178df770  
2019-02-06 14:23:03 - [types/wlr_pointer_constraints_v1.c:238] new locked_pointer 0x564b178d05f0 (res 0x564b1784db80)
2019-02-06 14:23:03 - [types/wlr_pointer_constraints_v1.c:351] constrained 0x564b178d05f0
2019-02-06 14:23:06 - [types/wlr_pointer_constraints_v1.c:47] destroying constraint 0x564b178d05f0
2019-02-06 14:23:09 - [types/wlr_pointer_constraints_v1.c:238] new confined_pointer x564b178feb40 (res 0x564b1784db80)
2019-02-06 14:23:09 - [types/wlr_pointer_constraints_v1.c:351] constrained 0x564b178feb40
2019-02-06 14:23:09 - [types/wlr_pointer_constraints_v1.c:47] destroying constraint 0x564b178feb40
2019-02-06 14:23:09 - [types/wlr_pointer_constraints_v1.c:238] new locked_pointer 0x564b178feb40 (res 0x564b1784db80)
2019-02-06 14:23:09 - [types/wlr_pointer_constraints_v1.c:351] constrained 0x564b178feb40
2019-02-06 14:23:10 - [types/wlr_pointer_constraints_v1.c:47] destroying constraint 0x564b178feb40
...

This happens regardless of whether the cursor shows up or not. Is the visibility of the cursor determined by this pointer constraint? Does sway decide whether or not to draw the OS cursor?

I can usually work around this (obnoxiously) by hitting Esc to bring up the menu, moving my cursor to my second monitor, moving cursor back, and returning to gameplay, however it does sometimes take a few tries for the cursor to come back.

Same Problem, but I noticed one more detail:
This is not true for the first interaction. After the pointer gets destroyed the first time it will not reappear.

Right click on chest, cursor doesn't show up
Right click on crafting table, cursor doesn't show up

Can't reproduce anymore.

The issue is not reproducible for me. My config is Sway 1.2 on Arch Linux using amdgpu, Minecraft is 1.7.10 w/ Forge and mods. I've only tested briefly so far, but from what I've seen, Minecraft is bug-free.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RyanDwyer picture RyanDwyer  路  3Comments

aidanharris picture aidanharris  路  3Comments

soymjolk picture soymjolk  路  3Comments

marcoms picture marcoms  路  3Comments

Olie440 picture Olie440  路  4Comments