forked from dorkbox/SystemTray
Merge branch 'master' into windows_native
This commit is contained in:
commit
324acb4353
@ -40,6 +40,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import dorkbox.systemTray.jna.linux.AppIndicator;
|
||||
import dorkbox.systemTray.jna.linux.Gtk;
|
||||
import dorkbox.systemTray.jna.linux.GtkEventDispatch;
|
||||
import dorkbox.systemTray.nativeUI._AppIndicatorNativeTray;
|
||||
import dorkbox.systemTray.nativeUI._AwtTray;
|
||||
import dorkbox.systemTray.nativeUI._GtkStatusIconNativeTray;
|
||||
@ -739,8 +740,8 @@ class SystemTray {
|
||||
|
||||
if (isNix) {
|
||||
// linux/unix need access to GTK, so load it up before the tray is loaded!
|
||||
Gtk.startGui();
|
||||
Gtk.waitForEventsToComplete();
|
||||
GtkEventDispatch.startGui();
|
||||
GtkEventDispatch.waitForEventsToComplete();
|
||||
}
|
||||
|
||||
|
||||
@ -753,15 +754,15 @@ class SystemTray {
|
||||
|
||||
if (AUTO_FIX_INCONSISTENCIES) {
|
||||
// this logic has to be before we create the system Tray, but after GTK is started (if applicable)
|
||||
if (OS.isWindows()) {
|
||||
if (OS.isWindows() && (isTrayType(trayType, TrayType.AWT) || isTrayType(trayType, TrayType.Swing))) {
|
||||
// windows hard-codes the image size
|
||||
SystemTrayFixes.fixWindows(trayImageSize);
|
||||
}
|
||||
else if (OS.isMacOsX()) {
|
||||
else if (OS.isMacOsX() && (isTrayType(trayType, TrayType.AWT) || isTrayType(trayType, TrayType.Swing))) {
|
||||
// macosx doesn't respond to all buttons (but should)
|
||||
SystemTrayFixes.fixMacOS();
|
||||
}
|
||||
else if (isNix) {
|
||||
else if (isNix && isTrayType(trayType, TrayType.Swing)) {
|
||||
// linux/mac doesn't have transparent backgrounds for swing and hard-codes the image size
|
||||
SystemTrayFixes.fixLinux(trayImageSize);
|
||||
}
|
||||
@ -790,7 +791,6 @@ class SystemTray {
|
||||
) {
|
||||
try {
|
||||
reference.set((Tray) trayType.getConstructors()[0].newInstance(systemTray));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Unable to create tray type: '" + trayType.getSimpleName() + "'", e);
|
||||
}
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux;
|
||||
|
||||
import com.sun.jna.Callback;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2015 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux;
|
||||
|
||||
import static dorkbox.systemTray.SystemTray.logger;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux;
|
||||
|
||||
import static dorkbox.systemTray.util.CssParser.injectAdditionalCss;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux.structs;
|
||||
|
||||
import java.awt.Color;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux.structs;
|
||||
|
||||
import java.awt.Color;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux.structs;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux.structs;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2017 dorkbox, llc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.systemTray.jna.linux.structs;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
Loading…
Reference in New Issue
Block a user