activate window with gtk_window_present instead of

XSendClientMessgeEvent(_NET_ACTIVE_WINDOW)
This commit is contained in:
foudfou 2012-03-07 14:41:05 +01:00
parent 56b0fe6332
commit b47e960755
2 changed files with 2 additions and 9 deletions

View File

@ -116,6 +116,7 @@ function gtk_defines(lib) {
lib.lazy_bind("gtk_window_stick", gobject.gint, this.GtkWindow.ptr);
lib.lazy_bind("gtk_window_maximize", gobject.gint, this.GtkWindow.ptr);
lib.lazy_bind("gtk_window_fullscreen", gobject.gint, this.GtkWindow.ptr);
lib.lazy_bind("gtk_window_present", ctypes.void_t, this.GtkWindow.ptr);
}

View File

@ -344,21 +344,13 @@ firetray.Window = {
// always returns 1 (BadRequest as a coincidence)
},
/**
* raises window on top and give focus.
*/
activate: function(xid) {
if (!firetray.Utils.prefService.getBoolPref('show_activates'))
return;
let dataSize = 3;
let data = ctypes.long(dataSize);
data[0] = 1; // source indication (0=none, 1=app, 2=pager)
data[1] = 0; // timestamp
data[2] = 0; // requestor's currently active window, 0 if none
this.xSendClientMessgeEvent(xid, x11.current.Atoms._NET_ACTIVE_WINDOW, data, dataSize);
gtk.gtk_window_present(firetray.Handler.gtkWindows.get(xid));
LOG("window raised");
},