[Pkg-mozext-commits] [firetray] 381/399: use 'focus-in' event for unsetting urgency hint
David Prévot
taffit at alioth.debian.org
Tue Oct 29 18:24:19 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 6615219f95924fc2b04fd677711d81e5e51cd08b
Author: foudfou <foudil.newbie+git at gmail.com>
Date: Tue Jul 23 23:35:21 2013 +0200
use 'focus-in' event for unsetting urgency hint
Unsetting urgency hint can't be base on MapNotify when working on a single
desktop.
---
src/modules/FiretrayHandler.jsm | 2 --
src/modules/ctypes/linux/gobject.jsm | 23 --------------
src/modules/linux/FiretrayChatStatusIcon.jsm | 29 -----------------
src/modules/linux/FiretrayWindow.jsm | 43 ++++++++++++++++++++++----
4 files changed, 37 insertions(+), 60 deletions(-)
diff --git a/src/modules/FiretrayHandler.jsm b/src/modules/FiretrayHandler.jsm
index ea59ec4..89003ed 100644
--- a/src/modules/FiretrayHandler.jsm
+++ b/src/modules/FiretrayHandler.jsm
@@ -277,13 +277,11 @@ firetray.Handler = {
if (enabled) {
firetray.Chat.init();
for (let winId in firetray.Handler.windows) {
- firetray.ChatStatusIcon.attachOnFocusInCallback(winId);
firetray.Chat.attachSelectListeners(firetray.Handler.windows[winId].chromeWin);
}
} else {
for (let winId in firetray.Handler.windows) {
- firetray.ChatStatusIcon.detachOnFocusInCallback(winId);
firetray.Chat.detachSelectListeners(firetray.Handler.windows[winId].chromeWin);
}
firetray.Chat.shutdown();
diff --git a/src/modules/ctypes/linux/gobject.jsm b/src/modules/ctypes/linux/gobject.jsm
index 6362c20..fb50f5e 100644
--- a/src/modules/ctypes/linux/gobject.jsm
+++ b/src/modules/ctypes/linux/gobject.jsm
@@ -52,29 +52,6 @@ Cu.import("resource://firetray/ctypes/linux/glib.jsm");
function gobject_defines(lib) {
- this.GdkEventMask = ctypes.int; // enum
- this.GDK_EXPOSURE_MASK = 1 << 1;
- this.GDK_POINTER_MOTION_MASK = 1 << 2;
- this.GDK_POINTER_MOTION_HINT_MASK = 1 << 3;
- this.GDK_BUTTON_MOTION_MASK = 1 << 4;
- this.GDK_BUTTON1_MOTION_MASK = 1 << 5;
- this.GDK_BUTTON2_MOTION_MASK = 1 << 6;
- this.GDK_BUTTON3_MOTION_MASK = 1 << 7;
- this.GDK_BUTTON_PRESS_MASK = 1 << 8;
- this.GDK_BUTTON_RELEASE_MASK = 1 << 9;
- this.GDK_KEY_PRESS_MASK = 1 << 10;
- this.GDK_KEY_RELEASE_MASK = 1 << 11;
- this.GDK_ENTER_NOTIFY_MASK = 1 << 12;
- this.GDK_LEAVE_NOTIFY_MASK = 1 << 13;
- this.GDK_FOCUS_CHANGE_MASK = 1 << 14;
- this.GDK_STRUCTURE_MASK = 1 << 15;
- this.GDK_PROPERTY_CHANGE_MASK = 1 << 16;
- this.GDK_VISIBILITY_NOTIFY_MASK = 1 << 17;
- this.GDK_PROXIMITY_IN_MASK = 1 << 18;
- this.GDK_PROXIMITY_OUT_MASK = 1 << 19;
- this.GDK_SUBSTRUCTURE_MASK = 1 << 20;
- this.GDK_SCROLL_MASK = 1 << 21;
- this.GDK_ALL_EVENTS_MASK = 0x3FFFFE;
this.GSignalMatchType = ctypes.int; // enum
this.G_SIGNAL_MATCH_ID = 1 << 0;
this.G_SIGNAL_MATCH_DETAIL = 1 << 1;
diff --git a/src/modules/linux/FiretrayChatStatusIcon.jsm b/src/modules/linux/FiretrayChatStatusIcon.jsm
index 0e44dd5..eec2650 100644
--- a/src/modules/linux/FiretrayChatStatusIcon.jsm
+++ b/src/modules/linux/FiretrayChatStatusIcon.jsm
@@ -38,7 +38,6 @@ firetray.ChatStatusIcon = {
return o;
})(),
themedIconNameCurrent: null,
- signals: {'focus-in': {callback: {}, handler: {}}},
timers: {},
init: function() {
@@ -113,34 +112,6 @@ firetray.ChatStatusIcon = {
setIconTooltipDefault: function() {
this.setIconTooltip(firetray.Handler.appName+" Chat");
- },
-
- attachOnFocusInCallback: function(xid) {
- log.debug("attachOnFocusInCallback xid="+xid);
- this.signals['focus-in'].callback[xid] =
- gtk.GCallbackWidgetFocusEvent_t(firetray.ChatStatusIcon.onFocusIn);
- this.signals['focus-in'].handler[xid] = gobject.g_signal_connect(
- firetray.Handler.gtkWindows.get(xid), "focus-in-event",
- firetray.ChatStatusIcon.signals['focus-in'].callback[xid], null);
- log.debug("focus-in handler="+this.signals['focus-in'].handler[xid]);
- },
-
- detachOnFocusInCallback: function(xid) {
- log.debug("detachOnFocusInCallback xid="+xid);
- let gtkWin = firetray.Handler.gtkWindows.get(xid);
- gobject.g_signal_handler_disconnect(gtkWin, this.signals['focus-in'].handler[xid]);
- delete this.signals['focus-in'].callback[xid];
- delete this.signals['focus-in'].handler[xid];
- },
-
- // NOTE: fluxbox issues a FocusIn event when switching workspace
- // by hotkey, which means 2 FocusIn events when switching to a moz app :(
- // (http://sourceforge.net/tracker/index.php?func=detail&aid=3190205&group_id=35398&atid=413960)
- onFocusIn: function(widget, event, data) {
- log.debug("onFocusIn");
- let xid = firetray.Window.getXIDFromGtkWidget(widget);
- log.debug("xid="+xid);
- firetray.Chat.stopGetAttentionMaybe(xid);
}
// FIXME: TODO: onclick/activate -> chatHandler.showCurrentConversation()
diff --git a/src/modules/linux/FiretrayWindow.jsm b/src/modules/linux/FiretrayWindow.jsm
index 3546a93..fd8eb38 100644
--- a/src/modules/linux/FiretrayWindow.jsm
+++ b/src/modules/linux/FiretrayWindow.jsm
@@ -58,6 +58,7 @@ firetray.Handler.gtkPopupMenuWindowItems = new ctypesMap(gtk.GtkImageMenuItem.pt
firetray.Window = {
+ signals: {'focus-in': {callback: {}, handler: {}}},
init: function() {
let gtkVersionCheck = gtk.gtk_check_version(
@@ -215,8 +216,8 @@ firetray.Window = {
return false;
}
+ firetray.Window.detachOnFocusInCallback(xid);
if (firetray.Handler.isChatEnabled() && firetray.Chat.initialized) {
- firetray.ChatStatusIcon.detachOnFocusInCallback(xid);
firetray.Chat.detachSelectListeners(firetray.Handler.windows[xid].chromeWin);
}
@@ -408,6 +409,7 @@ firetray.Window = {
},
setUrgency: function(xid, urgent) {
+ log.debug("setUrgency: "+urgent);
gtk.gtk_window_set_urgency_hint(firetray.Handler.gtkWindows.get(xid), urgent);
},
@@ -557,9 +559,6 @@ firetray.Window = {
firetray.Window.updateVisibility(xid, true);
log.debug("visibleWindowsCount="+firetray.Handler.visibleWindowsCount);
}
-
- if (xid === firetray.Handler.getActiveWindow())
- firetray.Window.setUrgency(xid, false);
break;
case x11.UnmapNotify: // for catching 'iconify'
@@ -619,8 +618,40 @@ firetray.Window = {
for(var key in firetray.Handler.windows);
firetray.Window.activate(key);
- }
+ },
+
+ attachOnFocusInCallback: function(xid) {
+ log.debug("attachOnFocusInCallback xid="+xid);
+ this.signals['focus-in'].callback[xid] =
+ gtk.GCallbackWidgetFocusEvent_t(firetray.Window.onFocusIn);
+ this.signals['focus-in'].handler[xid] = gobject.g_signal_connect(
+ firetray.Handler.gtkWindows.get(xid), "focus-in-event",
+ firetray.Window.signals['focus-in'].callback[xid], null);
+ log.debug("focus-in handler="+this.signals['focus-in'].handler[xid]);
+ },
+
+ detachOnFocusInCallback: function(xid) {
+ log.debug("detachOnFocusInCallback xid="+xid);
+ let gtkWin = firetray.Handler.gtkWindows.get(xid);
+ gobject.g_signal_handler_disconnect(gtkWin, this.signals['focus-in'].handler[xid]);
+ delete this.signals['focus-in'].callback[xid];
+ delete this.signals['focus-in'].handler[xid];
+ },
+
+ // NOTE: fluxbox issues a FocusIn event when switching workspace
+ // by hotkey, which means 2 FocusIn events when switching to a moz app :(
+ // (http://sourceforge.net/tracker/index.php?func=detail&aid=3190205&group_id=35398&atid=413960)
+ onFocusIn: function(widget, event, data) {
+ log.debug("onFocusIn");
+ let xid = firetray.Window.getXIDFromGtkWidget(widget);
+ log.debug("xid="+xid);
+
+ firetray.Window.setUrgency(xid, false);
+ if (firetray.Handler.isChatEnabled() && firetray.Chat.initialized) {
+ firetray.Chat.stopGetAttentionMaybe(xid);
+ }
+ }
}; // firetray.Window
@@ -671,8 +702,8 @@ firetray.Handler.registerWindow = function(win) {
this.windows[xid].startupFilterCb = gdk.GdkFilterFunc_t(firetray.Window.startupFilter);
gdk.gdk_window_add_filter(gdkWin, this.windows[xid].startupFilterCb, null);
+ firetray.Window.attachOnFocusInCallback(xid);
if (firetray.Handler.isChatEnabled() && firetray.Chat.initialized) {
- firetray.ChatStatusIcon.attachOnFocusInCallback(xid);
firetray.Chat.attachSelectListeners(win);
}
--
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