Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Popups in IntelliJ Idea break input

Open pshirshov opened this issue 2 years ago • 16 comments

Hyprland Version

88b63a00b68350d6d001445357a2582ab5975f9c

Bug or Regression?

Regression

Description

Something has been broken recently with IntelliJ intellisense popups. They start stealing focus from the main window thus breaking keyboard input.

How to reproduce

  1. Install IntelliJ Idea
  2. Create a project in any language
  3. Start typing and make the intellisense popup appear
  4. The main intellij window will lose the focus regardless of input:follow_mouse and mouse position. So it won't be possible to continue typing or to select anything in the popup using the keyboard
  5. You would have to manually refocus main window

Crash reports, logs, images, videos

No response

pshirshov avatar Sep 29 '23 12:09 pshirshov

This looks like https://github.com/hyprwm/Hyprland/issues/3012 but it worked for me before

pshirshov avatar Sep 29 '23 12:09 pshirshov

Suggested fix (windowrulev2 = noborder, class:^(jetbrains-idea)(.*)$) does not help.

windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*) seemingly makes things better (but still imperfect).

pshirshov avatar Sep 29 '23 12:09 pshirshov

It seems like this helps (but still, sometimes the main window loses focus during editing):

input {
  follow_mouse = 2
  float_switch_override_focus = 0
}

windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*)

pshirshov avatar Sep 29 '23 13:09 pshirshov

Currently I'm using the following rules which make the editor barely usable:

input {
  float_switch_override_focus=0
  follow_mouse=2
  mouse_refocus=1
}

xwayland {
  force_zero_scaling=true
}
windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*)
windowrulev2 = noborder, class:^(jetbrains-idea)(.*)$

Unfortunately the "noinitialfocus" rule completely breaks the menus:

idea-menus.webm

Moreover, noinitialfocus is not a reliable fix, it's just makes things better. The editor still loses focus from time to time.

pshirshov avatar Oct 09 '23 13:10 pshirshov

@pshirshov These are my window rules which fix a bunch of issues I've come across. These focus issues are related to xwayland applications running under wl-roots as the same problems happen in Sway as well.

# -- Fix odd behaviors in IntelliJ IDEs --
#! Fix focus issues when dialogs are opened or closed
windowrulev2 = windowdance,class:^(jetbrains-.*)$,floating:1
#! Fix splash screen showing in weird places and prevent annoying focus takeovers
windowrulev2 = center,class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = nofocus,class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = noborder,class:^(jetbrains-.*)$,title:^(splash)$,floating:1

#! Center popups/find windows
windowrulev2 = center,class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = stayfocused,class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = noborder,class:^(jetbrains-.*)$,title:^( )$,floating:1
#! Disable window flicker when autocomplete or tooltips appear
windowrulev2 = nofocus,class:^(jetbrains-.*)$,title:^(win.*)$,floating:1

Also add suppress.focus.stealing=false to your IDE properties.

I should mention that these do not "fix" everything. In my case, using a multi monitor setup will cause popups to open where ever they want sometimes. But at least the editor focus issues are fixed

Blackburn29 avatar Nov 17 '23 16:11 Blackburn29

Menus rendering remains broken with these properties.

pshirshov avatar Nov 17 '23 17:11 pshirshov

The biggest issue I have now is that the autocomplete popup rendering has been broken since 0.30 in hyprland. The key to the focus issues with the editor is the windowdance rule though

Blackburn29 avatar Nov 17 '23 18:11 Blackburn29

The biggest issue I have now is that the autocomplete popup rendering has been broken since 0.30 in hyprland.

Same here, do you have any recommended fixes for now? It seems that the window size is fine, it's the inner rendering of it?

liperium avatar Nov 21 '23 19:11 liperium

Currently I'm using the following rules which make the editor barely usable:

...
windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*)

Unfortunately the "noinitialfocus" rule completely breaks the menus

BTW that also applies to the waybar tooltips (noinitialfocus helps) and its tray-ed apps menus (unreachable)

ildar avatar Nov 27 '23 19:11 ildar

Currently I'm using the following rules which make the editor barely usable:

...
windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*)

Unfortunately the "noinitialfocus" rule completely breaks the menus

BTW that also applies to the waybar tooltips (noinitialfocus helps) and its tray-ed apps menus (unreachable)

Using the windowdance rule I have above is the only thing I've found that will keep the editor from constantly losing focus in tandem with the following IDE properties:

suppress.focus.stealing.active.window.checks=true
suppress.focus.stealing.disable.auto.request.focus=true

its far from perfect but I've been daily driving this setup professionally for a few months

The biggest issue I have now is that the autocomplete popup rendering has been broken since 0.30 in hyprland.

Same here, do you have any recommended fixes for now? It seems that the window size is fine, it's the inner rendering of it?

Appears to be an issue tracked in https://github.com/hyprwm/Hyprland/issues/2579

Blackburn29 avatar Nov 27 '23 21:11 Blackburn29

@Blackburn29's fixes (https://github.com/hyprwm/Hyprland/issues/3450#issuecomment-1816761575) seems to fix an issue on Hyprland with the xwl no-scaling patch with IntelliJ's New UI that causes unusable flickering when hovering over the left sidebar buttons.

See here for a demo of someone else having a similar problem in action https://youtrack.jetbrains.com/issue/RIDER-103759

@vaxerski is there any way we can make these settings default, in the Hyprland sample config, or at the very least, document this in the wiki?

fubuki4649 avatar Jan 18 '24 00:01 fubuki4649

Currently I'm using the following rules which make the editor barely usable:

input {
  float_switch_override_focus=0
  follow_mouse=2
  mouse_refocus=1
}

xwayland {
  force_zero_scaling=true
}
windowrulev2 = noinitialfocus,class:^(jetbrains-.*),title:^(win.*)
windowrulev2 = noborder, class:^(jetbrains-idea)(.*)$

Unfortunately the "noinitialfocus" rule completely breaks the menus: idea-menus.webm

Moreover, noinitialfocus is not a reliable fix, it's just makes things better. The editor still loses focus from time to time.

noinitialfocus doesnt break the menu with the new jetbrains UI. nofocus meanwhile breaks things like the search popup, or the new file popup. At least in the new UI.

fubuki4649 avatar Feb 01 '24 02:02 fubuki4649

Also add suppress.focus.stealing=false to your IDE properties.

Can someone please tell how/where to add this ?

I went through these but it's still confusing -> https://intellij-support.jetbrains.com/hc/en-us/community/posts/206874755-Don-t-steal-focus?page=3#community_comment_115000586044 https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties https://developer.android.com/studio/intro/studio-config.html#customize_ide

I am using android-studio

KAGEYAM4 avatar Feb 07 '24 04:02 KAGEYAM4

Can someone please tell how/where to add this ?

Help -> Edit Custom Properties...

mindrunner avatar Feb 07 '24 08:02 mindrunner

@pshirshov These are my window rules which fix a bunch of issues I've come across. These focus issues are related to xwayland applications running under wl-roots as the same problems happen in Sway as well.

# -- Fix odd behaviors in IntelliJ IDEs --
#! Fix focus issues when dialogs are opened or closed
windowrulev2 = windowdance,class:^(jetbrains-.*)$,floating:1
#! Fix splash screen showing in weird places and prevent annoying focus takeovers
windowrulev2 = center,class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = nofocus,class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = noborder,class:^(jetbrains-.*)$,title:^(splash)$,floating:1

#! Center popups/find windows
windowrulev2 = center,class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = stayfocused,class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = noborder,class:^(jetbrains-.*)$,title:^( )$,floating:1
#! Disable window flicker when autocomplete or tooltips appear
windowrulev2 = nofocus,class:^(jetbrains-.*)$,title:^(win.*)$,floating:1

Also add suppress.focus.stealing=false to your IDE properties.

I should mention that these do not "fix" everything. In my case, using a multi monitor setup will cause popups to open where ever they want sometimes. But at least the editor focus issues are fixed

How to fix, popup in android studio not clickable after unfocused from input https://github.com/hyprwm/Hyprland/assets/40895148/800dcaad-e3c5-4d4d-9645-c35011c3e0fe

nizarfadlan avatar Feb 21 '24 15:02 nizarfadlan

I've tried a lot of similar things, in the end I've given up on Hyprland for now.

pshirshov avatar Feb 21 '24 22:02 pshirshov

switching to experimental native wayland with jbr pre-release solves many of those issues

mindrunner avatar Feb 23 '24 17:02 mindrunner

For the people using Android Studio, I think the Canary channel has fixes. Will report back, but the popups and autocomplete seem to work fine without any tweaks for now.

liperium avatar Feb 26 '24 17:02 liperium

switching to experimental native wayland with jbr pre-release solves many of those issues

Could you please instruct me on how to do it?

edit: Found how to do it on JetBrains youtrack https://youtrack.jetbrains.com/issue/JBR-3206/Native-Wayland-support#focus=Comments-27-9421388.0-0

kamssiopeia avatar Mar 14 '24 15:03 kamssiopeia

With the beta runtime and the Hyprland config changes, for me, it's gone from crashing outright to just hanging for 10+ seconds half the time when I try to rename an identifier and working fine the other half.

reinux avatar Mar 16 '24 22:03 reinux

JetBrains IDE's now have experimental Wayland support Please try the versions in their Early Acess Program and see if they fix this issue. Relevant Download links: https://www.jetbrains.com/idea/nextversion/ https://www.jetbrains.com/pycharm/nextversion/ https://www.jetbrains.com/go/nextversion/

MightyPlaza avatar Jul 09 '24 20:07 MightyPlaza

OP doesn't seem to still use hyprland, has this been fixed?

MightyPlaza avatar Jul 09 '24 20:07 MightyPlaza

OP doesn't seem to still use hyprland, has this been fixed?

Use the latest jbr21 with the WLToolkit flag enabled in the IDE.

Blackburn29 avatar Jul 09 '24 21:07 Blackburn29

OP doesn't seem to still use hyprland, has this been fixed?

I use latest hyprland and intellij version and everything seems to work perfectly. Even coursor being "stuck" is fixed for me now

kamssiopeia avatar Jul 09 '24 21:07 kamssiopeia

alr thx @vaxerski

MightyPlaza avatar Jul 09 '24 21:07 MightyPlaza