Commit Graph

88 Commits

Author SHA1 Message Date
Uli Schlachter a6fb932bbc awesome: Add get_* and set_xproperty
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 18:23:34 +01:00
Uli Schlachter 62e2dee4ba Add awesome.register_xproperty (FS#1212)
This commits adds awesome.register_xproperty(). This allows lua code to register
arbitrary X11 properties with awesome which will then watch these properties.
Whenever such a property is changed on a client or drawin, we will emit the
xproperty::name signal.

This also adds window:get_xproperty(name) and window:set_xproperty(name, value)
which allows to mess with properties.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 16:17:40 +01:00
Uli Schlachter 389a54e356 Really ignore loops in transient_for (FS#1124)
The code in property_update_wm_transient_for() looked at the transient_for
relation before the new transient got set. However, the code is supposed to
check if we get a loop after introducing this new transient_for.

Thus, if we arrive back at the client that we started from, we can be sure that
there is a cycle. Signal this by setting the loop counter high enough to abort
the loop and make the rest of this function do nothing.

No idea how I missed this case before nor why I cannot reproduce this on debian,
but can reproduce it on Arch just fine.

Reported-By: Kasimir Knallkopf at http://article.gmane.org/gmane.comp.window-managers.awesome/10415
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-23 14:42:56 +01:00
Uli Schlachter ed66fda1f1 client: Ignore transient_for causing loops (FS#1124)
Lots of code assumes that it can recursively follow a client's transient_for
field until it reached an end without a transient_for client. Instead of fixing
all those places to properly handle loops, this patch just makes us ignore
WM_TRANSIENT_FOR if the property causes a loop.

This means that it can be a little random which WM_TRANSIENT_FOR property is
ignored, because it will always be the one that happens to complete the cycle. I
don't think that this is bad, because there shouldn't be any loops in the first
place.

Lots-of-kudos-to: David Mohr <david@mcbf.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 14:39:35 +02:00
Uli Schlachter 14722aa6e4 Fix WM_CLIENT_LEADER handling
This was broken since 5d0a81c8bf. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-19 19:23:19 +02:00
Uli Schlachter e57af377bb Don't pass cairo surfaces around on the lua stack
Now that the C code uses lightuserdata for passing around cairo surfaces, they
are no longer automatically garbage collected. To avoid memleaks, this commit
compares the C code to use cairo_surface_t pointers instead of the lua stack.

This also fixes a memleak were a client's icon was leaked.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-28 09:29:47 +02:00
Uli Schlachter 2bd29f2ab4 Add a wallpaper_changed signal
This signal fires whenever the, well, wallpaper changes. Who would have guessed?

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-07 21:52:24 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Arnaud Fontaine be7fda45d8 Update the code following release of xcb-util 0.3.8.
xcb-util is now split into several repositories since 0.3.8. This
release also cleaned up the API a lot, thus update the code
accordingly.

Signed-off-by: Arnaud Fontaine <arnau@debian.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-10 18:27:39 +02:00
Uli Schlachter 740db10951 Fix another case of unbalances lua stack
Previously, client_set_icon() popped the image that was being used. When I made
this use oocairo, I accidentally made this function not pop anything at all, so
the caller has to do this now.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 22:32:08 +02:00
Uli Schlachter e7cd824c07 Ignore changes to the root pixmap
We no longer use the root pixmap at all, so we can ignore changes to it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 15:10:04 +02:00
Uli Schlachter 5f5787d97b Wibox: Rename to drawin
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:36:02 +02:00
Uli Schlachter d213f19c5f Widgets: Remove
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:27:21 +02:00
Uli Schlachter 6b2e4352bb Remove globalconf.xinerama_is_active
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:20:45 +02:00
Uli Schlachter 32d9a5b2ab Remove support for zaphod mode
This makes awesome support only a single X11 protocol screen. If you are still
using zaphod mode, you can run multiple instances of awesome on the single
screens, e.g.:

DISPLAY=:1.0 awesome & DISPLAY=:1.1 awesome &

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 13:47:40 +02:00
Uli Schlachter ec63afc822 Track the last timestamp received from the server
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 14:37:39 +02:00
Uli Schlachter a89ca515f5 Remove another argument to property handlers
Since each handler is only for one single atom, there is no point in passing the
atom that was changed to the callback.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:06:32 +02:00
Uli Schlachter 709619b466 Push the property requests down
Instead of calling each property handler with a property reply, it's now up to
the handlers to request the properties.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:04:08 +02:00
Uli Schlachter 2f20494676 Overhaul property handling
For each property we handle, there is now a function which sends a request and
returns the cookie and a second function that takes the cookie and saves the
result in the client_t struct. This should make it possible to improve our
latency later on.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:03:16 +02:00
Gregor Best 5d0a81c8bf fix some deprecated atom constants
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 21:43:23 +02:00
Uli Schlachter fa5a25637d Remove some more unused function arguments
We no longer use libxcb-event, so we don't have to follow it's API any more.
This means the pointless arguments and return values can be removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 17:54:13 +02:00
Uli Schlachter 58bb601658 Stop using most of libxcb-event
Upstream removed most of the code from libxcb-event and there is no
event-related stuff left in this library. We now no longer use any of the parts
that were removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 17:35:48 +02:00
Uli Schlachter 0262e39609 Remove some unused function arguments
We no longer have to follow libxcb-property's API for these function, so we can
remove arguments which we don't use anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 16:54:36 +02:00
Uli Schlachter b64c989963 Stop using libxcb-property
libxcb-property will be dropped from xcb-utils in the next release, because
upstream thinks it's not really useful and well-designed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 16:45:56 +02:00
Julien Danjou 4f6667b56f property: remove unknown code
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:28:59 +02:00
Julien Danjou 220d072164 window: import class
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:27:42 +02:00
Ari Entlich 68b46c5bd2 Fix possible memory corruption (FS#734)
The memory referred to by the reply argument of
property_update_wm_protocols is automatically free'd
by xcb later on, so it is not safe to simply use the
value of reply in our own data structures. If we did
this, future calls to xcb_get_wm_protocols_reply_wipe
free the data which has already been free'd by xcb,
causing a double-free and corrupting the heap. In
addition, it isn't safe to use free'd memory as if
it is still allocated. Instead, duplicate the data
referred to by reply and use the duplicate instead.

It seems to me as if the duplication should actually
be done in xcb_get_wm_protocols_from_reply, but I'm
not really sure. If that is the case, this is simply
a work-around until xcb can be fixed.

Signed-off-by: Ari Entlich <atrigent@ccs.neu.edu>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-22 14:19:08 +01:00
Uli Schlachter becf3d514a property.c: Don't leave stuff on the lua stack
property_update_wm_hints() pushes the client but never pops it. This is a really
bad thing (tm).

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-02-09 19:46:32 +01:00
Julien Danjou 4daa5af04c globalconf: move prophs out
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-09 21:28:30 +01:00
Julien Danjou 3ce7638e0f window: rename to xwindow
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou e9ef51a521 wibox: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou 6fa62a3029 widgets: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Brian Gianforcaro c9ec34e61e Fix doxygen generation warnings
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-26 09:15:57 +02:00
Julien Danjou f149a6a55d property: fix typo in wm_name and wm_icon_name prop handling
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 16:52:18 +02:00
Julien Danjou 1337129191 property: split _NET_WM_{ICON_,}NAME from WM_{ICON_,}NAME
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 16:39:10 +02:00
koniu 9d15c36b33 property: fix class/instance mixup
Without this patch c.class shows the instance and vice versa.

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 09:47:07 +02:00
Uli Schlachter 2f1691e8db Fix HANDLE_TEXT_PROPERTY()
Instead of using the given atom name it always requested the WM_NAME property of
a client.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 21:58:06 +02:00
Julien Danjou 271063cc34 property: macrotify a bunch of handling functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 11:22:28 +02:00
Julien Danjou c862bf0534 property: use xcb_get_wm_protocols_from_reply
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 11:13:00 +02:00
Julien Danjou e5048f72d5 property: macrotify all text property retrieval
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 10:26:48 +02:00
Julien Danjou 8ec4f93a3a property: do not pop icon, client_set_icon does it
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-22 16:28:31 +02:00
Julien Danjou a6c0d9398e property: use provided reply to get machine
This avoid a roundtrip when getting a property change event.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-22 15:05:29 +02:00
Julien Danjou cf64b42d0d property: fix memory leak
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 23:30:19 +02:00
Julien Danjou a02d026f77 client: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 84839d456d wibox: port to new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou a916f2cd55 image: port to new class system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 1cc50b8a29 luaobject: remove useless custom function
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou 71f24097c0 client: store _NET_WM_OPACITY
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-10 11:59:17 +02:00
Julien Danjou ab361ffe85 client: store WM_WINDOW_ROLE
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-10 11:53:45 +02:00
Julien Danjou 9394e9a852 client: store _NET_WM_PID
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-10 11:49:52 +02:00