diff --git a/src/modules/ctypes/linux/x11.jsm b/src/modules/ctypes/linux/x11.jsm index 1e1c95b..a0dbc0c 100644 --- a/src/modules/ctypes/linux/x11.jsm +++ b/src/modules/ctypes/linux/x11.jsm @@ -24,7 +24,8 @@ const XATOMS_EWMH_GENERAL = [ "_NET_CLOSE_WINDOW", "_NET_WM_NAME", "_NET_WM_DESKTOP", "_NET_WM_WINDOW_TYPE", "_NET_WM_STATE", "_NET_WM_ALLOWED_ACTIONS", "_NET_WM_STRUT", "_NET_WM_STRUT_PARTIAL", "_NET_WM_ICON_GEOMETRY", "_NET_WM_ICON", "_NET_WM_PID", - "_NET_WM_HANDLED_ICONS", "_NET_WM_USER_TIME", "_NET_FRAME_EXTENTS" + "_NET_WM_HANDLED_ICONS", "_NET_WM_USER_TIME", "_NET_FRAME_EXTENTS", + "_NET_CURRENT_DESKTOP" ]; const XATOMS_EWMH_WM_STATES = [ "_NET_WM_STATE_MODAL", "_NET_WM_STATE_STICKY", @@ -34,7 +35,7 @@ const XATOMS_EWMH_WM_STATES = [ "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_BELOW", "_NET_WM_STATE_DEMANDS_ATTENTION" ]; -const XATOMS_EWMH_ROOT = [ "_NET_ACTIVE_WINDOW" ] +const XATOMS_EWMH_ROOT = [ "_NET_ACTIVE_WINDOW" ]; const XATOMS = XATOMS_ICCCM .concat(XATOMS_EWMH_WM_STATES) .concat(XATOMS_EWMH_GENERAL) diff --git a/src/modules/linux/FiretrayWindow.jsm b/src/modules/linux/FiretrayWindow.jsm index 13df633..95fb92a 100644 --- a/src/modules/linux/FiretrayWindow.jsm +++ b/src/modules/linux/FiretrayWindow.jsm @@ -350,8 +350,24 @@ firetray.Window = { activate: function(xid) { if (!firetray.Utils.prefService.getBoolPref('show_activates')) return; +try { + firetray.Utils.timer(function() { + let winDesktop = firetray.Window.getXWindowDesktop(x11.Window(xid)); + let rootWin = x11.XDefaultRootWindow(x11.current.Display); + firetray.WARN("winDesktop="+winDesktop+" rootWin="+rootWin+" xid="+xid); + if (winDesktop && rootWin) { + let dataSize = 3; + let data = ctypes.long(dataSize); + data[0] = winDesktop; + data[1] = 0; + data[2] = 0; + firetray.Window.xSendClientMessgeEvent(rootWin, x11.current.Atoms._NET_CURRENT_DESKTOP, data, dataSize); + } + gtk.gtk_window_present(firetray.Handler.gtkWindows.get(xid)); firetray.LOG("window raised"); + }, 1000, Ci.nsITimer.TYPE_ONE_SHOT); +} catch(x) {firetray.ERROR(x);} }, /**