Bug 977 - NEWT OSX MouseListener does not receive move events if windows is maximized
Summary: NEWT OSX MouseListener does not receive move events if windows is maximized
Status: RESOLVED DUPLICATE of bug 1223
Alias: None
Product: Jogl
Classification: JogAmp
Component: macosx (show other bugs)
Version: 2.3.2
Hardware: All all
: --- normal
Assignee: Sven Gothel
Depends on:
Reported: 2014-02-16 20:01 CET by johan
Modified: 2015-10-05 09:02 CEST (History)
1 user (show)

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description johan 2014-02-16 20:01:07 CET
A GLWindow is created and a mouse listener registered. The listener receives public void mouseMoved(MouseEvent e)
If the window is maximized (pressing the green "plus" button on the window decoration) the move events aren't received. Draggable events are sent if you keep the mouse button pressed.
Un-maximizing and the resizing the window the move events are again sent.

Using JogAmp 2.1.4, JDK 1.8.0-ea-b121, OSX 10.9.
This seems a regression, it did not happen in 2.1.4-rc-20131224

The following test class can be used to illustrate the problem.

import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
import java.io.IOException;
import javax.media.nativewindow.WindowClosingProtocol;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;

public class MouseListenerBug {

	public static void main(String... args) {
		MouseListenerBug app = new MouseListenerBug();

	private void run() {
		final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
		GLWindow glWindow = GLWindow.create(caps);
		glWindow.setSize(1024, 768);

		glWindow.addGLEventListener(new GLEventListener() {
			public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
				System.out.println("Reshape <" + width + "," + height + ">");

			public void init(GLAutoDrawable drawable) {

			public void dispose(GLAutoDrawable drawable) {

			public void display(GLAutoDrawable drawable) {

		glWindow.addMouseListener(new MouseAdapter() {
			public void mouseMoved(MouseEvent e) {
				short x = (short) e.getX();
				short y = (short) e.getY();
				System.out.println("Mouse moved <" + x + "," + y + ">");

			public void mouseDragged(MouseEvent e) {
				short x = (short) e.getX();
				short y = (short) e.getY();
				System.out.println("Mouse dragged <" + x + "," + y + ">");

			public void mousePressed(MouseEvent e) {

				if (!e.isAutoRepeat()) {
					System.out.println("Mouse button pressed" + e);

			public void mouseReleased(MouseEvent e) {

				if (!e.isAutoRepeat()) {
					System.out.println("Mouse button pressed" + e);


		Animator animator = new Animator(glWindow);

Comment 1 Julien Gouesse 2014-02-16 20:35:40 CET
Have you checked whether the fix for the bug 970 causes this regression?
Comment 2 johan 2014-02-16 21:02:41 CET
(In reply to comment #1)
> Have you checked whether the fix for the bug 970 causes this regression?

No, I'm a bit lost when it comes to building/debugging jogl from source :) I just updated from rc-20131224 to 2.1.4 release and noticed that my mouse listener did not get any events.
Comment 3 johan 2014-03-12 19:38:41 CET
Just tested with 2.1.5-01 release. The behaviour is not exactly the same. Now when maximizing the window there are no mouse events, but if I click once on the window frame or inside the window mouse move events are registered. It feels like when maximizing the window looses focus. When you click somewhere on it it regains focus and mouse move events are sent as expected.
Comment 4 Sven Gothel 2015-10-05 09:02:12 CEST

*** This bug has been marked as a duplicate of bug 1223 ***