Skip to content

Commit

Permalink
decorations: fix get xid error on wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
jonian committed Nov 29, 2018
1 parent ead06a8 commit 44878d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions unite@hardpixel.eu/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ function scaleSize(initialSize) {
return initialSize * context.scale_factor;
}

function getWindowXID(win) {
let desc = win.get_description().toString();
let match = desc.match(/0x[0-9a-f]+/) || [null];

return match[0];
}

function isWindow(win) {
if (!win) return;

Expand Down
3 changes: 2 additions & 1 deletion unite@hardpixel.eu/modules/windowDecoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const GLib = imports.gi.GLib;
const Util = imports.misc.util;
const Unite = imports.misc.extensionUtils.getCurrentExtension();
const Base = Unite.imports.module.BaseModule;
const getWindowXID = Unite.imports.helpers.getWindowXID;
const isWindow = Unite.imports.helpers.isWindow;
const isMaximized = Unite.imports.helpers.isMaximized;
const loadUserStyles = Unite.imports.helpers.loadUserStyles;
Expand Down Expand Up @@ -31,7 +32,7 @@ var WindowDecoration = new Lang.Class({
},

_getWindowXID(win) {
win._windowXID = win._windowXID || win.get_description().match(/0x[0-9a-f]+/)[0];
win._windowXID = win._windowXID || getWindowXID(win);
return win._windowXID;
},

Expand Down

0 comments on commit 44878d4

Please # to comment.