mirror of
https://github.com/moparisthebest/FireTray
synced 2024-12-21 05:28:48 -05:00
* display popup menu window items for all application, not only browsers
* cleaning
This commit is contained in:
parent
6fb8a15f22
commit
bd83ca9304
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
build/
|
||||
build*/
|
||||
|
@ -203,8 +203,7 @@ firetray.PopupMenu = {
|
||||
},
|
||||
|
||||
windowItemsHandled: function() {
|
||||
return (firetray.Handler.inBrowserApp &&
|
||||
firetray.Utils.prefService.getBoolPref('hides_single_window'));
|
||||
return firetray.Utils.prefService.getBoolPref('hides_single_window');
|
||||
}
|
||||
|
||||
}; // firetray.PopupMenu
|
||||
|
@ -258,6 +258,16 @@ firetray.Window = {
|
||||
firetray.Handler.showHideIcon();
|
||||
},
|
||||
|
||||
startupHide: function(xid) {
|
||||
log.debug('startupHide: '+xid);
|
||||
|
||||
firetray.Handler.windows[xid].baseWin.visibility = false;
|
||||
firetray.Window.updateVisibility(xid, false);
|
||||
|
||||
firetray.PopupMenu.showWindowItem(xid);
|
||||
firetray.Handler.showHideIcon();
|
||||
},
|
||||
|
||||
savePositionAndSize: function(xid) {
|
||||
let gx = {}, gy = {}, gwidth = {}, gheight = {};
|
||||
firetray.Handler.windows[xid].baseWin.getPositionAndSize(gx, gy, gwidth, gheight);
|
||||
@ -489,10 +499,10 @@ firetray.Window = {
|
||||
let title = firetray.Handler.windows[xid].baseWin.title;
|
||||
log.debug("|baseWin.title="+title+"|");
|
||||
let tailIndex;
|
||||
if (firetray.Handler.appId === FIRETRAY_APP_DB['seamonkey']['id'])
|
||||
tailIndex = title.indexOf(" - Mozilla "+firetray.Handler.appName);
|
||||
if (tailIndex === -1)
|
||||
tailIndex = title.indexOf(" - "+firetray.Handler.appName);
|
||||
else
|
||||
tailIndex = title.indexOf(" - Mozilla "+firetray.Handler.appName);
|
||||
|
||||
if (tailIndex !== -1)
|
||||
return title.substring(0, tailIndex);
|
||||
else if (title === "Mozilla "+firetray.Handler.appName)
|
||||
@ -514,25 +524,6 @@ firetray.Window = {
|
||||
}
|
||||
},
|
||||
|
||||
startupFilter: function(xev, gdkEv, data) {
|
||||
if (!xev)
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
|
||||
let xany = ctypes.cast(xev, x11.XAnyEvent.ptr);
|
||||
let xid = xany.contents.window;
|
||||
|
||||
if (xany.contents.type === x11.MapNotify) {
|
||||
if (firetray.Utils.prefService.getBoolPref('start_hidden')) {
|
||||
log.debug("start_hidden");
|
||||
firetray.Window.hide(xid);
|
||||
}
|
||||
gdk.gdk_window_remove_filter(firetray.Handler.gdkWindows.get(xid),
|
||||
firetray.Handler.windows[xid].startupFilterCb, null);
|
||||
}
|
||||
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
},
|
||||
|
||||
filterWindow: function(xev, gdkEv, data) {
|
||||
if (!xev)
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
@ -580,6 +571,25 @@ firetray.Window = {
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
},
|
||||
|
||||
startupFilter: function(xev, gdkEv, data) {
|
||||
if (!xev)
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
|
||||
let xany = ctypes.cast(xev, x11.XAnyEvent.ptr);
|
||||
let xid = xany.contents.window;
|
||||
|
||||
if (xany.contents.type === x11.MapNotify) {
|
||||
if (firetray.Utils.prefService.getBoolPref('start_hidden')) {
|
||||
log.debug("start_hidden");
|
||||
firetray.Window.startupHide(xid);
|
||||
}
|
||||
gdk.gdk_window_remove_filter(firetray.Handler.gdkWindows.get(xid),
|
||||
firetray.Handler.windows[xid].startupFilterCb, null);
|
||||
}
|
||||
|
||||
return gdk.GDK_FILTER_CONTINUE;
|
||||
},
|
||||
|
||||
showAllWindowsAndActivate: function() {
|
||||
let visibilityRate = firetray.Handler.visibleWindowsCount/firetray.Handler.windowsCount;
|
||||
log.debug("visibilityRate="+visibilityRate);
|
||||
|
Loading…
Reference in New Issue
Block a user