From 12922a448b1ee5f9b9d3b14a6aab9e413c6893b7 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Mon, 30 May 2016 22:54:51 +0100 Subject: [PATCH 01/10] Adding XSetWMProtocols method --- contrib/platform/src/com/sun/jna/platform/unix/X11.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/platform/src/com/sun/jna/platform/unix/X11.java b/contrib/platform/src/com/sun/jna/platform/unix/X11.java index 1b2e3cea1b..4d809966d3 100644 --- a/contrib/platform/src/com/sun/jna/platform/unix/X11.java +++ b/contrib/platform/src/com/sun/jna/platform/unix/X11.java @@ -795,6 +795,8 @@ void XSetWMProperties(Display display, Window window, String window_name, String icon_name, String[] argv, int argc, XSizeHints normal_hints, Pointer wm_hints, Pointer class_hints); + + int XSetWMProtocols(Display display, Window window, Atom[] atom, int count); int XFree(Pointer data); Window XCreateSimpleWindow(Display display, Window parent, int x, int y, int width, int height, int border_width, From a2c5ca6bb1bb746b80f85ecb487555e9dd982f03 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Mon, 30 May 2016 23:50:18 +0100 Subject: [PATCH 02/10] Adding test for XSetWMProtocols --- .../platform/test/com/sun/jna/platform/unix/X11Test.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index 30d1dc466e..fce9776511 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -76,6 +76,12 @@ public void testXFetchName() { } } + public void testSetWMProtocols() { + Atom[] protocols = new Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); + assertEquals("Bad status for XSetWMProtocols", 1, status); + } + public static void main(java.lang.String[] argList) { junit.textui.TestRunner.run(X11Test.class); } From e1fcf5a5e960118e389ab53b8bd1fe802d21935e Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Mon, 30 May 2016 23:55:50 +0100 Subject: [PATCH 03/10] Adding test for XSetWMProtocols --- contrib/platform/test/com/sun/jna/platform/unix/X11Test.java | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index fce9776511..7f769e0d1b 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -80,6 +80,7 @@ public void testSetWMProtocols() { Atom[] protocols = new Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); assertEquals("Bad status for XSetWMProtocols", 1, status); + } public static void main(java.lang.String[] argList) { From 25ec0b17c863a45318c8fb4ee95535d14fa9a358 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Tue, 31 May 2016 00:08:02 +0100 Subject: [PATCH 04/10] Adding test for XSetWMProtocols --- contrib/platform/test/com/sun/jna/platform/unix/X11Test.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index 7f769e0d1b..e460a29df6 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -77,10 +77,9 @@ public void testXFetchName() { } public void testSetWMProtocols() { - Atom[] protocols = new Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + X11.Atom[] protocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); assertEquals("Bad status for XSetWMProtocols", 1, status); - } public static void main(java.lang.String[] argList) { From 391a0d213eeb955bd2f65efa816c0ebf6ac5ee75 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Fri, 3 Jun 2016 18:51:56 +0100 Subject: [PATCH 05/10] Adding XGetWMProtocols to X11 --- .../src/com/sun/jna/platform/unix/X11.java | 2 ++ .../test/com/sun/jna/platform/unix/X11Test.java | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/contrib/platform/src/com/sun/jna/platform/unix/X11.java b/contrib/platform/src/com/sun/jna/platform/unix/X11.java index 4d809966d3..c268f7e722 100644 --- a/contrib/platform/src/com/sun/jna/platform/unix/X11.java +++ b/contrib/platform/src/com/sun/jna/platform/unix/X11.java @@ -797,6 +797,8 @@ void XSetWMProperties(Display display, Window window, String window_name, Pointer class_hints); int XSetWMProtocols(Display display, Window window, Atom[] atom, int count); + int XGetWMProtocols(Display display, Window w, Atom[] protocols_return, IntByReference count_return); + int XFree(Pointer data); Window XCreateSimpleWindow(Display display, Window parent, int x, int y, int width, int height, int border_width, diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index e460a29df6..1c63e4a5d6 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -15,6 +15,7 @@ import java.awt.GraphicsEnvironment; import com.sun.jna.ptr.PointerByReference; +import com.sun.jna.ptr.IntByReference; import junit.framework.TestCase; @@ -76,12 +77,24 @@ public void testXFetchName() { } } - public void testSetWMProtocols() { + public void testXSetWMProtocols() { X11.Atom[] protocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); assertEquals("Bad status for XSetWMProtocols", 1, status); } + public void testXGetWMProtocols() { + X11.Atom[] setProtocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + X11.INSTANCE.XSetWMProtocols(display, root, setProtocols, 1); + + X11.Atom[] protocols = new X11.Atom[1]; + IntByReference count = new IntByReference(); + int status = X11.INSTANCE.XGetWMProtocols(display, root, protocols, count); + assertEquals("Bad status for XGetWMProtocols", 1, status); + assertEquals("Wrong number of protocols returned for XGetWMProtocols", count.getValue(), 1); + assertNotNull("No protocols returned for XGetWMProtocols", protocols[0]); + } + public static void main(java.lang.String[] argList) { junit.textui.TestRunner.run(X11Test.class); } From 4c85e1dc33dd1b1e33f6c7b4383c15bbc0d0c1cb Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 3 Jun 2016 19:04:39 +0100 Subject: [PATCH 06/10] Added XSetWMProtocols and XGetWMProtocols to X11 --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 31099ae6b0..9d7bf760f9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,7 @@ Features * [#644](https://github.com/java-native-access/jna/pull/644): New ant target 'install' for installing JNA artifacts in local m2-repository - [@SevenOf9Sleeper](https://github.com/SevenOf9Sleeper). * [#649](https://github.com/java-native-access/jna/pull/649): Bugfix msoffice sample and add two samples taken from MSDN and translated from VisualBasic to Java - [@matthiasblaesing](https://github.com/matthiasblaesing). * [#654](https://github.com/java-native-access/jna/pull/654): Support named arguments for `com.sun.jna.platform.win32.COM.util.CallbackProxy` based callbacks - [@matthiasblaesing](https://github.com/matthiasblaesing). +* [#665](https://github.com/java-native-access/jna/pull/665): Added `XSetWMProtocols` and `XGetWMProtocols` to `com.sun.jna.platform.unix.X11` - [@zainab-ali](https://github.com/zainab-ali). Bug Fixes --------- From 9a963c493ff8ea5b8e9226bcf37d5af1fb956850 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Tue, 7 Jun 2016 04:11:08 +0100 Subject: [PATCH 07/10] Amending XGetWMProtocols for X11 --- .../src/com/sun/jna/platform/unix/X11.java | 2 +- .../com/sun/jna/platform/unix/X11Test.java | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/contrib/platform/src/com/sun/jna/platform/unix/X11.java b/contrib/platform/src/com/sun/jna/platform/unix/X11.java index c268f7e722..43c883f190 100644 --- a/contrib/platform/src/com/sun/jna/platform/unix/X11.java +++ b/contrib/platform/src/com/sun/jna/platform/unix/X11.java @@ -797,7 +797,7 @@ void XSetWMProperties(Display display, Window window, String window_name, Pointer class_hints); int XSetWMProtocols(Display display, Window window, Atom[] atom, int count); - int XGetWMProtocols(Display display, Window w, Atom[] protocols_return, IntByReference count_return); + int XGetWMProtocols(Display display, Window w, PointerByReference protocols_return, IntByReference count_return); int XFree(Pointer data); Window XCreateSimpleWindow(Display display, Window parent, int x, int y, diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index 1c63e4a5d6..a1b106d629 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -18,6 +18,7 @@ import com.sun.jna.ptr.IntByReference; import junit.framework.TestCase; +import org.junit.Assert; /** * Exercise the {@link X11} class. @@ -78,21 +79,29 @@ public void testXFetchName() { } public void testXSetWMProtocols() { - X11.Atom[] protocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; - int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); - assertEquals("Bad status for XSetWMProtocols", 1, status); + X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + int status = X11.INSTANCE.XSetWMProtocols(display, root, atoms, atoms.length); + Assert.assertNotEquals("Bad status for XSetWMProtocols", 0, status); } public void testXGetWMProtocols() { - X11.Atom[] setProtocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; - X11.INSTANCE.XSetWMProtocols(display, root, setProtocols, 1); + X11.Atom[] sentAtoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false), X11.INSTANCE.XInternAtom(display, "WM_TAKE_FOCUS", false) }; + X11.INSTANCE.XSetWMProtocols(display, root, sentAtoms, sentAtoms.length); - X11.Atom[] protocols = new X11.Atom[1]; + PointerByReference protocols = new PointerByReference(); IntByReference count = new IntByReference(); + int status = X11.INSTANCE.XGetWMProtocols(display, root, protocols, count); - assertEquals("Bad status for XGetWMProtocols", 1, status); - assertEquals("Wrong number of protocols returned for XGetWMProtocols", count.getValue(), 1); - assertNotNull("No protocols returned for XGetWMProtocols", protocols[0]); + + X11.Atom[] receivedAtoms = new X11.Atom[count.getValue()]; + for(int i = count.getValue() - 1; i >= 0; i--) { + receivedAtoms[i] = new X11.Atom(protocols.getValue().getLong(X11.Atom.SIZE * i)); + } + X11.INSTANCE.XFree(protocols.getValue()); + + Assert.assertNotEquals("Bad status for XGetWMProtocols", 0, status); + Assert.assertEquals("Wrong number of protocols returned for XGetWMProtocols", sentAtoms.length, receivedAtoms.length); + Assert.assertArrayEquals("Sent protocols were not equal to returned procols", sentAtoms, receivedAtoms); } public static void main(java.lang.String[] argList) { From f26ac1859b345a7267d63a7a7e64ebe72b6590ed Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Tue, 7 Jun 2016 04:31:47 +0100 Subject: [PATCH 08/10] Amending XGetWMProtocols for X11 --- .../com/sun/jna/platform/unix/#X11Test.java# | 112 ++++++++++++++++++ .../com/sun/jna/platform/unix/X11Test.java | 2 +- 2 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# diff --git a/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# b/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# new file mode 100644 index 0000000000..bd038dce3e --- /dev/null +++ b/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# @@ -0,0 +1,112 @@ +/* Copyright (c) 2015 Timothy Wall, All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + *

+ * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.unix; + +import java.awt.GraphicsEnvironment; + +import com.sun.jna.ptr.PointerByReference; +import com.sun.jna.ptr.IntByReference; + +import junit.framework.TestCase; +import org.junit.Assert; + +/** + * Exercise the {@link X11} class. + * + * @author twalljava@java.net + */ +// @SuppressWarnings("unused") +public class X11Test extends TestCase { + + private X11.Display display = null; + private X11.Window root = null; + + @Override + protected void setUp() { + if (!GraphicsEnvironment.isHeadless()) { + display = X11.INSTANCE.XOpenDisplay(null); + if (display == null) { + throw new IllegalStateException("Can't open default display"); + } + root = X11.INSTANCE.XRootWindow(display, X11.INSTANCE.XDefaultScreen(display)); + if (root == null) { + throw new IllegalStateException("Can't find root window"); + } + } + } + + @Override + protected void tearDown() { + if (display != null) { + X11.INSTANCE.XCloseDisplay(display); + } + } + + @Override + protected void runTest() throws Throwable { + if (!GraphicsEnvironment.isHeadless()) { + super.runTest(); + } + } + + public void testXrender() { + X11.Xrender.XRenderPictFormat s = new X11.Xrender.XRenderPictFormat(); + s.getPointer().setInt(0, 25); + s.read(); + } + + public void testXFetchName() { + PointerByReference pref = new PointerByReference(); + int status = X11.INSTANCE.XFetchName(display, root, pref); + try { + assertEquals("Bad status for XFetchName", 0, status); + } + finally { + if (pref.getValue() != null) { + X11.INSTANCE.XFree(pref.getValue()); + } + } + } + + public void testXSetWMProtocols() { + X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + int status = X11.INSTANCE.XSetWMProtocols(display, root, atoms, atoms.length); + Assert.assertNotEquals("Bad status for XSetWMProtocols", 0, status); + } + + public void testXGetWMProtocols() { + X11.Atom[] sentAtoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false), X11.INSTANCE.XInternAtom(display, "WM_TAKE_FOCUS", false) }; + X11.INSTANCE.XSetWMProtocols(display, root, sentAtoms, sentAtoms.length); + + PointerByReference protocols = new PointerByReference(); + IntByReference count = new IntByReference(); + + int status = X11.INSTANCE.XGetWMProtocols(display, root, protocols, count); + + X11.Atom[] receivedAtoms = new X11.Atom[count.getValue()]; + for(int i = count.getValue() - 1; i >= 0; i--) { + receivedAtoms[i] = new X11.Atom(protocols.getValue().getLong(X11.Atom.SIZE * i)); + } + X11.INSTANCE.XFree(protocols.getValue()); + + Assert.assertNotEquals("Bad status for XGetWMProtocols", 0, status); + Assert.assertEquals("Wrong number of protocols returned for XGetWMProtocols", sentAtoms.length, receivedAtoms.length); + Assert.assertArrayEquals("Sent protocols were not equal to returned procols for XGetWMProtocols", sentAtoms, receivedAtoms); + } + + public static void main(java.lang.String[] argList) { + junit.textui.TestRunner.run(X11Test.class); + } +} + + diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index a1b106d629..bd038dce3e 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -101,7 +101,7 @@ public void testXGetWMProtocols() { Assert.assertNotEquals("Bad status for XGetWMProtocols", 0, status); Assert.assertEquals("Wrong number of protocols returned for XGetWMProtocols", sentAtoms.length, receivedAtoms.length); - Assert.assertArrayEquals("Sent protocols were not equal to returned procols", sentAtoms, receivedAtoms); + Assert.assertArrayEquals("Sent protocols were not equal to returned procols for XGetWMProtocols", sentAtoms, receivedAtoms); } public static void main(java.lang.String[] argList) { From 717f7f68ea3a343f37eefdb2c95c81486637b730 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Tue, 7 Jun 2016 04:34:59 +0100 Subject: [PATCH 09/10] Amending XGetWMProtocols for X11 --- .../com/sun/jna/platform/unix/#X11Test.java# | 112 ------------------ 1 file changed, 112 deletions(-) delete mode 100644 contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# diff --git a/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# b/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# deleted file mode 100644 index bd038dce3e..0000000000 --- a/contrib/platform/test/com/sun/jna/platform/unix/#X11Test.java# +++ /dev/null @@ -1,112 +0,0 @@ -/* Copyright (c) 2015 Timothy Wall, All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - *

- * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.unix; - -import java.awt.GraphicsEnvironment; - -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.ptr.IntByReference; - -import junit.framework.TestCase; -import org.junit.Assert; - -/** - * Exercise the {@link X11} class. - * - * @author twalljava@java.net - */ -// @SuppressWarnings("unused") -public class X11Test extends TestCase { - - private X11.Display display = null; - private X11.Window root = null; - - @Override - protected void setUp() { - if (!GraphicsEnvironment.isHeadless()) { - display = X11.INSTANCE.XOpenDisplay(null); - if (display == null) { - throw new IllegalStateException("Can't open default display"); - } - root = X11.INSTANCE.XRootWindow(display, X11.INSTANCE.XDefaultScreen(display)); - if (root == null) { - throw new IllegalStateException("Can't find root window"); - } - } - } - - @Override - protected void tearDown() { - if (display != null) { - X11.INSTANCE.XCloseDisplay(display); - } - } - - @Override - protected void runTest() throws Throwable { - if (!GraphicsEnvironment.isHeadless()) { - super.runTest(); - } - } - - public void testXrender() { - X11.Xrender.XRenderPictFormat s = new X11.Xrender.XRenderPictFormat(); - s.getPointer().setInt(0, 25); - s.read(); - } - - public void testXFetchName() { - PointerByReference pref = new PointerByReference(); - int status = X11.INSTANCE.XFetchName(display, root, pref); - try { - assertEquals("Bad status for XFetchName", 0, status); - } - finally { - if (pref.getValue() != null) { - X11.INSTANCE.XFree(pref.getValue()); - } - } - } - - public void testXSetWMProtocols() { - X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; - int status = X11.INSTANCE.XSetWMProtocols(display, root, atoms, atoms.length); - Assert.assertNotEquals("Bad status for XSetWMProtocols", 0, status); - } - - public void testXGetWMProtocols() { - X11.Atom[] sentAtoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false), X11.INSTANCE.XInternAtom(display, "WM_TAKE_FOCUS", false) }; - X11.INSTANCE.XSetWMProtocols(display, root, sentAtoms, sentAtoms.length); - - PointerByReference protocols = new PointerByReference(); - IntByReference count = new IntByReference(); - - int status = X11.INSTANCE.XGetWMProtocols(display, root, protocols, count); - - X11.Atom[] receivedAtoms = new X11.Atom[count.getValue()]; - for(int i = count.getValue() - 1; i >= 0; i--) { - receivedAtoms[i] = new X11.Atom(protocols.getValue().getLong(X11.Atom.SIZE * i)); - } - X11.INSTANCE.XFree(protocols.getValue()); - - Assert.assertNotEquals("Bad status for XGetWMProtocols", 0, status); - Assert.assertEquals("Wrong number of protocols returned for XGetWMProtocols", sentAtoms.length, receivedAtoms.length); - Assert.assertArrayEquals("Sent protocols were not equal to returned procols for XGetWMProtocols", sentAtoms, receivedAtoms); - } - - public static void main(java.lang.String[] argList) { - junit.textui.TestRunner.run(X11Test.class); - } -} - - From cb1c52bedf41d1c4a38e68466524b6702cfb77b9 Mon Sep 17 00:00:00 2001 From: Zainab Ali Date: Fri, 10 Jun 2016 12:37:41 +0100 Subject: [PATCH 10/10] Testing multiple atoms in XSetWmProtocols for X11 --- contrib/platform/test/com/sun/jna/platform/unix/X11Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java index bd038dce3e..9b367172c9 100644 --- a/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java +++ b/contrib/platform/test/com/sun/jna/platform/unix/X11Test.java @@ -79,7 +79,7 @@ public void testXFetchName() { } public void testXSetWMProtocols() { - X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; + X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false), X11.INSTANCE.XInternAtom(display, "WM_TAKE_FOCUS", false) }; int status = X11.INSTANCE.XSetWMProtocols(display, root, atoms, atoms.length); Assert.assertNotEquals("Bad status for XSetWMProtocols", 0, status); }