diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul index 874ec7b..0065e4c 100644 --- a/src/chrome/content/options.xul +++ b/src/chrome/content/options.xul @@ -23,6 +23,7 @@ + @@ -58,6 +59,10 @@ + diff --git a/src/chrome/locale/en-US/options.dtd b/src/chrome/locale/en-US/options.dtd index 58dc23f..79cad26 100644 --- a/src/chrome/locale/en-US/options.dtd +++ b/src/chrome/locale/en-US/options.dtd @@ -1,4 +1,4 @@ - + @@ -16,6 +16,9 @@ + + + diff --git a/src/defaults/preferences/prefs.js b/src/defaults/preferences/prefs.js index 0da0d16..9e7fdc9 100644 --- a/src/defaults/preferences/prefs.js +++ b/src/defaults/preferences/prefs.js @@ -11,6 +11,8 @@ pref("extensions.firetray.hides_on_close", true); pref("extensions.firetray.hides_on_minimize", true); pref("extensions.firetray.hides_single_window", false); pref("extensions.firetray.start_hidden", false); +pref("extensions.firetray.show_raised", false); + pref("extensions.firetray.show_icon_on_hide", false); pref("extensions.firetray.scroll_hides", true); pref("extensions.firetray.scroll_mode", "down_hides"); diff --git a/src/modules/ctypes/gdk.jsm b/src/modules/ctypes/gdk.jsm index 84df88e..e858514 100644 --- a/src/modules/ctypes/gdk.jsm +++ b/src/modules/ctypes/gdk.jsm @@ -248,6 +248,7 @@ function gdk_defines(lib) { lib.lazy_bind("gdk_drawable_get_size", ctypes.void_t, this.GdkDrawable.ptr, gobject.gint.ptr, gobject.gint.ptr); // lib.lazy_bind("gdk_window_get_geometry", ctypes.void_t, this.GdkWindow.ptr, gobject.gint.ptr, gobject.gint.ptr, gobject.gint.ptr, gobject.gint.ptr, gobject.gint.ptr); lib.lazy_bind("gdk_window_move_resize", ctypes.void_t, this.GdkWindow.ptr, gobject.gint, gobject.gint, gobject.gint, gobject.gint); + lib.lazy_bind("gdk_window_raise", ctypes.void_t, this.GdkWindow.ptr); lib.lazy_bind("gdk_atom_intern", this.GdkAtom, gobject.gchar.ptr, gobject.gboolean); lib.lazy_bind("gdk_property_change", ctypes.void_t, this.GdkWindow.ptr, this.GdkAtom, this.GdkAtom, gobject.gint, this.GdkPropMode, gobject.guchar.ptr, gobject.gint); diff --git a/src/modules/gtk2/FiretrayWindow.jsm b/src/modules/gtk2/FiretrayWindow.jsm index edc07d4..fe2d603 100644 --- a/src/modules/gtk2/FiretrayWindow.jsm +++ b/src/modules/gtk2/FiretrayWindow.jsm @@ -263,19 +263,12 @@ firetray.Window = { delete firetray.Handler.windows[xid].savedDesktop; }, -/* KEPT FOR LATER USE - onWindowState: function(gtkWidget, gdkEventState, userData) { - LOG("window-state-event: "+gdkEventState.contents.new_window_state); - - if (gdkEventState.contents.new_window_state & gdk.GDK_WINDOW_STATE_ICONIFIED) { - let xid = firetray.Window.getXIDFromGtkWidget(gtkWidget); - LOG(xid+" iconified: "+gdkEventState.contents.changed_mask+" "+gdkEventState.contents.new_window_state); - } - - let stopPropagation = true; // not usefull - return stopPropagation; + ensureRaised: function(xid) { + if (!firetray.Utils.prefService.getBoolPref('show_raised')); + return; + let gdkWin = firetray.Handler.gdkWindows.get(xid); + gdk.gdk_window_raise(gdkWin); }, -*/ /** * YOU MUST x11.XFree() THE VARIABLE RETURNED BY THIS FUNCTION @@ -303,7 +296,7 @@ firetray.Window = { return [null, null]; } if (strEquals(actual_type.value, x11.None)) { - WARN("property not found"); + LOG("property not found"); return [null, null]; } @@ -315,7 +308,6 @@ firetray.Window = { ERROR("unsupported format: "+actual_format.value); } LOG("format OK"); -// FIXME: how about https://developer.mozilla.org/en/JavaScript_typed_arrays var props = ctypes.cast(prop_value, ctypes.unsigned_long.array(nitems.value).ptr); LOG("props="+props+", size="+props.constructor.size); @@ -495,6 +487,7 @@ firetray.Handler.showSingleWindow = function(xid) { firetray.Window.restoreWindowStates(xid); firetray.Handler.windows[xid].baseWin.visibility = true; // show firetray.Window.restoreWindowDesktop(xid); // after show + firetray.Window.ensureRaised(xid); // TODO: we need want to restore to the original monitor (screen) firetray.Handler.windows[xid].visibility = true;