Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor windows flicker on mouse movements when GTK_IM_MODULE is set #270

Closed
fbgihu opened this issue Jul 24, 2022 · 31 comments
Closed

Editor windows flicker on mouse movements when GTK_IM_MODULE is set #270

fbgihu opened this issue Jul 24, 2022 · 31 comments
Labels
Linux/GTK Happens on Linux

Comments

@fbgihu
Copy link

fbgihu commented Jul 24, 2022

Hi, I'm running Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2022-06 (4.24.0) Build id: 20220609-1112 on Linux Mint 20.2 Operating System: Linux Mint 20.2 (Kernel: Linux 5.4.0-122-generic Architecture: x86-64)

All editor windows "flicker". They switch to empty gray and back to text on mouse movements. This happens only to editor windows. Other views (Project Explorer, Outline...) stay calm and do not flicker. It's only the editor windows.

Any ideas on that? This makes Eclipse unuseable for me and forces me to switch to another IDE after roughly 20 years with Eclipse.

@iloveeclipse iloveeclipse transferred this issue from eclipse-platform/.github Jul 24, 2022
@iloveeclipse
Copy link
Member

Wayland? Can you try X11? Can you also try 4.25 nightly build, like rhis one: https://download.eclipse.org/eclipse/downloads/drops4/I20220723-1800

@fbgihu
Copy link
Author

fbgihu commented Jul 24, 2022 via email

@Phillipus
Copy link
Contributor

Phillipus commented Jul 24, 2022

Mint doesn't use Wayland, so you will be on X11.

I run Eclipse fine on Mint (Cinnamon edition), although in a VM.

@fbgihu Can you try Eclipse 4.23 and see if that has the same problem? Or try a different theme?

@niraj-modi niraj-modi added the Linux/GTK Happens on Linux label Jul 25, 2022
@fbgihu
Copy link
Author

fbgihu commented Jul 25, 2022

Same problem on 4.23 and also on 4.22. It wasn't on 2019-09.

@Phillipus
Copy link
Contributor

Cinnamon, MATE or Xfce edition?

@fbgihu
Copy link
Author

fbgihu commented Jul 25, 2022 via email

@mickaelistria
Copy link
Contributor

FWIW, I've been using Wayland on Fedora for several years now and there is no such problem.
Does your log file (in ${workspace}/.metadata/.log) show anything relevant?

@Phillipus
Copy link
Contributor

  • What kind of Eclipse editor do you see this in? Java? Plain Text?
  • What mouse actions cause it? Move? Scroll?
  • What Eclipse theme are you using?
  • What Mint theme are you using?
  • Are you running Mint in a VM? Native?
  • Is your graphics driver up to date?
  • Have you tried a clean install of Mint and Eclipse?

@fbgihu
Copy link
Author

fbgihu commented Jul 26, 2022

FWIW, I've been using Wayland on Fedora for several years now and there is no such problem.

I don't know, wether I use Wayland or X11. If Philipus is right in his comment above, then Mint doesn't use Wayland.

Does your log file (in ${workspace}/.metadata/.log) show anything relevant?

The contents of a log file freshly started:

!SESSION 2022-07-26 18:34:07.766 -----------------------------------------------
eclipse.buildId=4.24.0.I20220607-0700
java.version=11.0.15
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.jface 2 0 2022-07-26 18:34:12.010
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2022-07-26 18:34:12.010
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
		Open a type in a Java editor,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2351255a,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
		,
		Category(org.eclipse.lsp4e.category,Language Servers,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@4f836d9,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2022-07-26 18:34:12.010
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
		Rename the selected element,
		Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2a4f1bc5,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
		Rename the selected item,
		Category(org.eclipse.ui.category.file,File,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@224e7aa5,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)

Solving those two conflicts doesn't fix the flicker problem.

@fbgihu
Copy link
Author

fbgihu commented Jul 26, 2022

  • What kind of Eclipse editor do you see this in? Java? Plain Text?

All kinds of editors: Java, plain text, even strcutured editor for pom.xml. Project explorer, package explorer, outline and other views are totally NOT effected. It's only the editors and it looks like a faulty refresh/redraw routine, that fires without reason.

  • What mouse actions cause it? Move? Scroll?

Entering the editor window frame does, moving around in the editor too, scrolling in the editor too. If you leave the editor view and click another view, eg. package explorer, it takes the editor a few seconds to calm down and then you can move around in package explorer without flickering the editor view. I can also scroll in package explorer with no flickering anywhere. Editor flickers only, if it has the focus or the mouse over it. And it stops flickering a few seconds after I stop moving the mouse. It does not flicker on keystrokes.

  • What Eclipse theme are you using?

Never used theming. General > Appearance has theming turned off.

  • What Mint theme are you using?

Mint-Y

  • Are you running Mint in a VM? Native?

Native

  • Is your graphics driver up to date?

Don't know. It's a fairly simple Intel Mainboard interated HD Graphics 530 and I do all updates as they come from LINUX/MINT. Nothing else on my PC behaves like the editor views of Eclipse. No LibreOffice, no browser, no VLC, nothing. Eclipse itself doesn't flicker besides the editors. This looks to me simply like some errorneous fired redraw/refresh routine. Is it possible to enhance logging?

  • Have you tried a clean install of Mint and Eclipse?

I don't have a second machine for a fresh Mint install. In the meantime I have a lot of fresh Eclipse installations. All behave the same.

@mickaelistria
Copy link
Contributor

I suspect it's not an issue with editors but with StyledText. Can you please run the CustomControlExample as described in https://www.eclipse.org/swt/examples.php#standaloneOutsideEclipse and report whether the "StyledText" tab seems to behave properly or whether it shows the issue?

@fbgihu
Copy link
Author

fbgihu commented Jul 26, 2022

mickaelistria, thank you for this really quick response. It took me a while to figure out the examples but now I have them running and there is no "StyledText" tab ?!?. There is only a "Text" tab and that behaves without flicker as it should. Am I using the correct SWT.jar? I use

plugins/org.eclipse.swt.gtk.linux.x86_64_3.120.0.v20220530-1036.jar

There are also

plugins/org.eclipse.e4.ui.swt.gtk_1.1.100.v20210108-1832.jar
plugins/org.eclipse.e4.ui.css.swt_0.14.500.v20220511-1639.jar
plugins/org.eclipse.e4.ui.workbench.renderers.swt_0.15.500.v20220511-1638.jar
plugins/org.eclipse.e4.ui.css.swt.theme_0.13.100.v20220310-1056.jar
plugins/org.eclipse.swt_3.120.0.v20220530-1036.jar
plugins/org.eclipse.e4.ui.workbench.addons.swt_1.4.400.v20211102-0453.jar
plugins/org.eclipse.e4.ui.workbench.swt_0.16.500.v20220506-1520.jar

Upon starting, terminal throws two warnings:

***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues.
***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced. 

@iloveeclipse
Copy link
Member

Upon starting, terminal throws two warnings:

***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues.
***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced. 

Could you please do just that before starting Eclipse?
Isn't that exact the problem you see?

@Phillipus
Copy link
Contributor

Could you please do just that before starting Eclipse?
Isn't that exact the problem you see?

Bingo! I tested this by setting GTK_IM_MODULE=xim and I can now see the flickering. @fbgihu Why do you think this is set so in your environment?

@fbgihu
Copy link
Author

fbgihu commented Jul 26, 2022

Sounds good, but how do I set GTK_IM_MODULE just before starting eclipse? Is it meant as a UNIX environment variable?

@Phillipus
Copy link
Contributor

You need export GTK_IM_MODULE=ibus in a terminal and run Eclipse from the terminal with ./eclipse or create an executable .sh script like this:

#!/bin/bash
export GTK_IM_MODULE=ibus
./eclipse

But maybe GTK_IM_MODULE=xim is set somewhere in a configuration file in your system?

@Phillipus
Copy link
Contributor

@fbgihu
Copy link
Author

fbgihu commented Jul 26, 2022

That's it. Thank you very much for your support !!
For future users with same problem: I did not do anything to that GTK_IM_MODULE Variable. I even didn't know, that it exiists. So where does it come from and what has it changed?

@iloveeclipse
Copy link
Member

I wonder if Eclipse launcher should unset this variable on Linux if it is set to "xim", if editors are unusable with that "xim" thing? Or we could log an error in IDE if we detect that?

@sravanlakkimsetti, @akurtakov : WDYT?

@ericwill
Copy link
Contributor

I wonder if Eclipse launcher should unset this variable on Linux if it is set to "xim", if editors are unusable with that "xim" thing? Or we could log an error in IDE if we detect that?

@sravanlakkimsetti, @akurtakov : WDYT?

That's already the case on GNOME: https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Display.java#L1091-L1104

@iloveeclipse
Copy link
Member

That's already the case on GNOME

No, I mean properly log that to IDE log, not to console. No one watches console on Gnome (especially if Eclipse isn't started from the shell), and if one would, it is full of useless GTK critical warnings.

I also mean unset variable from the launcher before JVM is started.

And btw, nice to hear from you again, Eric.

@ericwill
Copy link
Contributor

I saw there was another victim of the GTK_IM_MODULE nonsense and felt the need to comment 😆

@akurtakov
Copy link
Member

I'm not sure what will happen if unsetting the variable, my guess would be that some "default" (which could happen to be xim again) will be used.

@Phillipus
Copy link
Contributor

I'm not sure what will happen if unsetting the variable, my guess would be that some "default" (which could happen to be xim again) will be used.

On my Linux Mint VM GTK_IM_MODULE is not set and Eclipse is happy with that.

@mickaelistria mickaelistria changed the title Editor windows flicker on mouse movements Editor windows flicker on mouse movements when GTK_IM_MODULE is set Jul 27, 2022
@fbgihu
Copy link
Author

fbgihu commented Jul 30, 2022

For future victims:

  • I've found an entry named im-launch in Mint's startup menu (Cinnamon-settings as well as Gnome-session-properties). That entry was checked. Unckecking and rebooting does not solve the problem. GTK_IM_MODULE stays on xim.
  • Something to bite in the table: While I always started Eclipse from Mint's start menu or sometimes from a terminal window, there is a third way to start it: from the desktop icon. And that icon has the following command property: env GTK_IM_MODULE=ibus /home/fmb/dev/eclipse/2021-12-l2ee/eclipse/eclipse. So if one uses the desktop icon, everything is fine...ouch.
  • I've added that export GTK_IM_MODULE=ibus to my /etc/profile and now Eclipse works from start menu as well as from desktop icon.

Thanks again to all helpers and commenters for your support

@fbgihu fbgihu closed this as completed Jul 30, 2022
@Phillipus
Copy link
Contributor

Is it possible to change System.err messages to Eclipse log messages? Or is Display not able to get the Eclipse Workbench logger?

And could the following be changed to enforce ibus in all cases not just Gnome? (I commented out the OS.isGNOME condition but it didn't work on Linux Mint)

// Enforce ibus as the input module on GNOME
if (OS.isGNOME) {
    long settings = GTK.gtk_settings_get_default ();
    byte[] ibus = Converter.wcsToMbcs ("ibus", true);
    if (settings != 0) OS.g_object_set (settings, GTK.gtk_im_module, ibus, 0);
}

@mickaelistria
Copy link
Contributor

Or is Display not able to get the Eclipse Workbench logger?

Usually, SWT code doesn't know anything about workbench and platform. However it should be possible, and welcome, to use a standard Java logger (eg System.Logger) and make Platform listen to this logger to copy/redirect information to the Eclipse log.

@mickaelistria
Copy link
Contributor

I opened #280 on the topic of improving logging.

@mrunalinidudhagawali8
Copy link

what about windows users? facing the same issue in my 4.21.0 :(

@SyntevoAlex
Copy link
Member

It is very unlikely that you have the same problem on Windows, even if the symptoms are somewhat similar. Please report a new Issue with a good description, preferably also record a video.

@mrunalinidudhagawali8
Copy link

sure @SyntevoAlex !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux/GTK Happens on Linux
Projects
None yet
Development

No branches or pull requests

9 participants