Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cinnamon-maximus@fmete: Fix broken window ID getter #430

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cinnamon-maximus@fmete/files/cinnamon-maximus@fmete/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,25 @@ function logMessage(message, alwaysLog = false) {
/** Guesses the X ID of a window.
*
* After muffin 2.4 the get_xwindow() returns the integer value
* instead Window object. So no need use a lot of hacks.
* instead Window object. So no need use a lot of hacks
*
* After Cinnamon 5.4.12 (or possibly earlier), get_xwindow no
* longer exists but get_description returns the ID
*/
function guessWindowXID(win) {
let id = null;
let additionalErrorMsg = null;
try {
id = win.get_xwindow();
id = win.get_description();
if (id)
return id;
} catch (err) {
additionalErrorMsg = err;
// Could call 'xprop -root _NET_ACTIVE_WINDOW' here as a
// fallback if/when get_description changes
}
// debugging for when people find bugs.. always logging this message.
logMessage("Could not find XID for window with title '${win.title}", true);
logMessage("Could not find XID for window with title '${win.title}" + (additionalErrorMsg?": " + additionalErrorMsg:""), true);
return null;
}

Expand Down