Merge pull request #875 from psychon/sn-fix

Startup-Notification fix
This commit is contained in:
Emmanuel Lepage Vallée 2016-05-08 01:03:16 -04:00
commit d497cdf081
3 changed files with 17 additions and 6 deletions

View File

@ -1241,8 +1241,19 @@ HANDLE_GEOM(height)
xcb_get_property_reply(globalconf.connection, startup_id_q, NULL); xcb_get_property_reply(globalconf.connection, startup_id_q, NULL);
/* Say spawn that a client has been started, with startup id as argument */ /* Say spawn that a client has been started, with startup id as argument */
char *startup_id = xutil_get_text_property_from_reply(reply); char *startup_id = xutil_get_text_property_from_reply(reply);
c->startup_id = startup_id;
p_delete(&reply); p_delete(&reply);
if (startup_id == NULL && c->leader_window != XCB_NONE) {
/* GTK hides this property elsewhere. No idea why. */
startup_id_q = xcb_get_property(globalconf.connection, false,
c->leader_window, _NET_STARTUP_ID,
XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
reply = xcb_get_property_reply(globalconf.connection, startup_id_q, NULL);
startup_id = xutil_get_text_property_from_reply(reply);
p_delete(&reply);
}
c->startup_id = startup_id;
spawn_start_notify(c, startup_id); spawn_start_notify(c, startup_id);
luaA_class_emit_signal(L, &client_class, "list", 0); luaA_class_emit_signal(L, &client_class, "list", 0);

View File

@ -3,7 +3,7 @@ local spawn = require("awful.spawn")
-- This file provide a simple, yet flexible, test client. -- This file provide a simple, yet flexible, test client.
-- It is used to test the `awful.rules` -- It is used to test the `awful.rules`
return function(class, title) return function(class, title, use_sn)
title = title or 'Awesome test client' title = title or 'Awesome test client'
local cmd = {"lua" , "-e", table.concat { local cmd = {"lua" , "-e", table.concat {
@ -28,5 +28,5 @@ return function(class, title)
"app:run {''}" "app:run {''}"
}} }}
spawn(cmd) return spawn(cmd, use_sn)
end end

View File

@ -1,7 +1,7 @@
--- Tests for spawn's startup notifications. --- Tests for spawn's startup notifications.
local runner = require("_runner") local runner = require("_runner")
local spawn = require("awful.spawn") local test_client = require("_client")
local manage_called, c_snid local manage_called, c_snid
@ -15,7 +15,7 @@ local ret, snid
local steps = { local steps = {
function(count) function(count)
if count == 1 then if count == 1 then
ret, snid = spawn('urxvt', true) ret, snid = test_client("foo", "bar", true)
elseif manage_called then elseif manage_called then
assert(ret) assert(ret)
assert(snid) assert(snid)
@ -29,7 +29,7 @@ local steps = {
function(count) function(count)
if count == 1 then if count == 1 then
manage_called = false manage_called = false
ret, snid = spawn('urxvt', false) ret, snid = test_client("bar", "foo", false)
elseif manage_called then elseif manage_called then
assert(ret) assert(ret)
assert(snid == nil) assert(snid == nil)