[Pkg-mozext-commits] [firetray] 161/399: option for ensuring windows are restored on top

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23:34 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit 2a313d907a1882a130173eb01744f8cd72154676
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Fri Feb 3 22:24:47 2012 +0100

    option for ensuring windows are restored on top
---
 src/chrome/content/options.xul      |    5 +++++
 src/chrome/locale/en-US/options.dtd |    5 ++++-
 src/defaults/preferences/prefs.js   |    2 ++
 src/modules/ctypes/gdk.jsm          |    1 +
 src/modules/gtk2/FiretrayWindow.jsm |   21 +++++++--------------
 5 files changed, 19 insertions(+), 15 deletions(-)

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 @@
       <preference id="pref_bool_hides_on_minimize" name="extensions.firetray.hides_on_minimize" type="bool"/>
       <preference id="pref_bool_hides_single_window" name="extensions.firetray.hides_single_window" type="bool"/>
       <preference id="pref_bool_start_hidden" name="extensions.firetray.start_hidden" type="bool"/>
+      <preference id="pref_bool_show_raised" name="extensions.firetray.show_raised" type="bool"/>
       <preference id="pref_bool_show_icon_on_hide" name="extensions.firetray.show_icon_on_hide" type="bool"/>
       <preference id="pref_bool_scroll_hides" name="extensions.firetray.scroll_hides" type="bool" />
       <preference id="pref_string_scroll_mode" name="extensions.firetray.scroll_mode" type="string" />
@@ -58,6 +59,10 @@
             <checkbox id="ui_start_hidden" preference="pref_bool_start_hidden"
                       label="&bool_start_hidden.label;"
                       accesskey="&bool_start_hidden.accesskey;"/>
+            <checkbox id="ui_show_raised" preference="pref_bool_show_raised"
+                      label="&bool_show_raised.label;"
+                      accesskey="&bool_show_raised.accesskey;"
+                      tooltiptext="&bool_show_raised.tooltip;"/>
           </groupbox>
 
           <groupbox>
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 @@
-<!ENTITY prefwindow.title "FireTray preferences">
+<!ENTITY prefwindow.title "y preferences">
 <!ENTITY pane1.title "FireTray preferences">
 
 <!ENTITY NOT_IMPLEMENTED_YET "NOT IMPLEMENTED YET">
@@ -16,6 +16,9 @@
 <!ENTITY bool_hides_single_window.accesskey "H">
 <!ENTITY bool_start_hidden.label "Start application hidden to tray">
 <!ENTITY bool_start_hidden.accesskey "S">
+<!ENTITY bool_show_raised.label "Ensure windows are restored on top">
+<!ENTITY bool_show_raised.accesskey "E">
+<!ENTITY bool_show_raised.tooltip "otherwise let the window manager handle it">
 
 <!ENTITY icon_settings "Icon settings">
 <!ENTITY bool_show_icon_on_hide.label "Show tray icon only if a window is hidden">
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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list