Commit Graph

233 Commits

Author SHA1 Message Date
Uli Schlachter cbdf403637 Fix fallback for the window type
EWMH specifies that

   If _NET_WM_WINDOW_TYPE is not set, then managed windows with WM_TRANSIENT_FOR
   set MUST be taken as [_NET_WM_WINDOW_TYPE_DIALOG].

We implement this by forcing a window's type to be "dialog" when it has a
WM_TRANSIENT_FOR property. For windows that have a _NET_WM_WINDOW_TYPE property,
this type change is then later undone. However, when a window changes its
WM_TRANSIENT_FOR property during runtime, then we would set its type to "dialog"
unconditionally.

This commit fixes this by explicitly tracking if we found a _NET_WM_WINDOW_TYPE
property on the window and only applying the fallback if we did not find such a
property.

Fixes-one-of-the-sub-issues-from: https://github.com/awesomeWM/awesome/issues/889
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-14 14:10:27 +02:00
Emmanuel Lepage Vallee 299e155acc client: Extend request::tag instead of awful.tag.withcurrent
There was a regression when refactoring the API. It was no longer
possible to disable the automatic tag selection.

Due to recent changes, it was no longer possible to disable the
default tag selection handler. This commit extend the already
existing request::tag mechanism to let handlers select the tags.
2016-04-20 00:11:04 -04:00
Uli Schlachter b2be471faf Fix icons
Since commit ea94f7f7e6, the code has a preferred icon size and it tries to
find the closest matching icon. However, the default size of 0 and thus this
never returned any icon at all (no icon matches better than an icon of size
0x0).

Fix this by saying "every icon is better than no icon at all".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:19:18 +01:00
Uli Schlachter daff5cd58b Refactor _NET_WM_ICON parsing
This shouldn't change the logic here, but hopefully makes it easier to
understand.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:16:24 +01:00
Lukáš Hrázký ea94f7f7e6 add an option to set the preferred client icon size
_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
2015-12-07 22:59:32 +01:00
Uli Schlachter 6ca85af53b Set WM_CLASS and WM_NAME on all our windows (#551)
The only exception is the window for _NET_SUPPORTING_WM_CHECK. That window
already had a _NET_WM_NAME property before and doesn't get a WM_NAME property in
this commit. I just decided for myself that it doesn't need one. :-)

Right after startup with the default config we now have the following situation:

$ xwininfo -root -tree

xwininfo: Window id: 0x2d7 (the root window) (has no name)

  Root window id: 0x2d7 (the root window) (has no name)
  Parent window id: 0x0 (none)
     7 children:
     0x200011 "Awesome drawin": ("awesome" "awesome")  1500x20+0+0  +0+0
     0x200010 "Awesome drawin": ("awesome" "awesome")  1x1+0+0  +0+0
     0x20000d "Awesome drawin": ("awesome" "awesome")  100x30+0+0  +0+0
     0x20000a "Awesome no input window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200009 "Awesome systray window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200008 "awesome": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200007 "Awesome WM_Sn selection owner window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1

One of those drawin is the awful.wibox. Another drawin is created by awful.menu.
I guess that the third one is created by awful.tooltip, but I'm not sure. Wow,
so many windows...

Closes https://github.com/awesomeWM/awesome/pull/556.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 22:23:25 +01:00
Uli Schlachter 4a094fa482 Add support for _NET_FRAME_EXTENTS
Support for this property is required since EWMH version 1.3.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-05 14:45:51 +02:00
Daniel Hahler cb7f4b06eb Use `hints` table argument with `request::activate` signal 2015-06-25 06:47:39 +02:00
Daniel Hahler ed09d8ed4f Use request::activate with raise=false instead
Ref: https://github.com/awesomeWM/awesome/pull/224#issuecomment-101790416
2015-06-25 06:47:39 +02:00
Daniel Hahler 72659a5ebb Merge pull request #122 from blueyed/fix-ldoc-doxygen-warnings
doc: fix doxygen settings / warnings
2015-02-15 11:49:50 +01:00
Daniel Hahler 8919faa7b3 doc: fix warnings from doxygen 2015-02-14 20:17:13 +01:00
Emmanuel Lepage Vallee d688ebe6cd Add new request::urgent signal
This fix two things:

(1) Clients asking to be urgent while focussed, this have been reported
a few time for urxvt and I usually link a patch that fix this. This may
not be considered a bug by some, but I think it is.

(2) Add the ability to stop noisy clients from setting the urgent state
themselves.
2015-02-10 19:27:46 +00:00
Uli Schlachter e5120e1bec Hide globalconf.L
Everything that needs the lua_State should create a local variable like this:

  lua_State *L = globalconf_get_lua_State();

This ensures that the compiler warns if there are two variables with name "L" in
scope. The idea here is that it should become harder to accidentally use the
global lua state instead of the state of the current state.

While writing this commit, I found another place that gets its wrong: Reading
client.focus from a coroutine was broken, since it was returning the result on
the main thread instead of the current one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 11:56:58 +01:00
Emmanuel Lepage Vallee 37684abe33 Add context to request::activate signal 2014-10-25 23:31:23 -04:00
Uli Schlachter d2b1e92f9e Clean up header includes
Every .c file has to include the corresponding .h file first to make sure the
headers are self-contained. Additionally, this moves some unneeded includes
around.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 20:07:48 +02:00
Uli Schlachter d8b73de739 screen.[ch]: Move into objects/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 15:12:47 +02:00
Uli Schlachter 873358a0b8 EWMH: Handle _NET_WM_DESKTOP in lua
We now handle all "important" EWMH messages in lua and lua can decide to do
different things than the current obvious one.

Consistency!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 16:15:20 +01:00
Uli Schlachter 9e4270f2e7 ewmh: Use client_set_sticky() for making clients sticky
We can't just directly assign c->sticky directly, because we should emit the
right signals and unban the client if it is currently ban. All of that gets
handled by client_set_sticky().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 15:38:20 +01:00
Uli Schlachter a9e0d258b7 EWMH: Ignore invalid _NET_WM_DESKTOP
Commit e291c0398 already made awesome ignore invalid values for _NET_WM_DESKTOP.
That commit just made it tag clients with the first tag if they used an invalid
value for this property.

This commit reverts 90% of that change. What is still left is the range
validation. Previously, awesome would untag a client completely when it got such
a _NET_WM_DESKTOP property / message. Now, such messages are just silently
ignored.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 15:34:44 +01:00
Uli Schlachter 61fdd8cd40 ewmh: Factor out common code into a helper function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 15:33:28 +01:00
Uli Schlachter 2ac95b4ae8 Fix handling of _NET_CURRENT_DESKTOP messages (FS#1219,FS#1217)
Instead of having the C code mess with which tags are selected, we now emit a
signal on the tag that says that something requested it to be selected. Lua can
then handle this by only switching tags on the correct monitor and by updating
the focus history correctly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-08 15:33:34 +01:00
Uli Schlachter 04dee81d13 client: Add request::activate signal (FS#848)
When we receive a _NET_ACTIVE_WINDOW request on the root window, we used to just
focus and raise the window. This didn't do much for clients which are on
non-selected tags.

Thus, this commit makes awesome emit request::activate on the client instead.
This is used in awful.ewmh to implement the old behavior again, but with
additionally marking the client as urgent if it isn't visible.

People who don't like this behavior can use client.disconnect_signal to disable
this behavior again. To make this really possible, awful.ewmh becomes a
"non-nil" module.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 17:47:55 +01:00
Uli Schlachter 1703801728 ewmh: remove _NET_DESKTOP_GEOMETRY support
Our tag concept doesn't really fit into ewmh. Thus, we were setting this
property to a way too small value anyway (just the size of the first screen in
case of multiple screens).

Since this property is optional in ewmh, let's just drop it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-27 23:01:49 +02:00
Stefan Haller ca73777017 Raise the window on EWMH request.
Additionally to handing over the focus to the window this commit raises
the window too. Otherwise a window which is hidden below other windows can
request the focus and because the window is not fully exposed, the user is
unaware which window has the input focus and is actually receiving the
keystrokes.

Signed-off-by: Stefan Haller <haliner@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:04:15 +01:00
Uli Schlachter 8348d44444 Tags: Remove screen property
A tag's screen is now implemented purely in lua and it is no longer C's
business.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-23 10:05:34 +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
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
Uli Schlachter f931af7ce1 Rename globalconf.client_focus to focus.client
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:46:56 +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 146a5dd67c Convert a client's icon to a cairo surface
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 13:18:35 +02:00
Uli Schlachter b6fa779972 Wibox type: Make this work correctly
The last commit caused some lua errors and reading a wibox' type property
didn't work. This should all be fixed now.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-28 13:07:31 +02:00
Uli Schlachter b0f125a664 ewmh: Use the libxcb define
WINDOW is a deprecated define which will be removed. We should be using
XCB_ATOM_WINDOW instead.

This is a follow-up to 5d0a81c8bf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-15 21:25:54 +02:00
Uli Schlachter 32d389bb48 ewmh: Stop using the "new" signal in C
As with the previous commit, signals on objects will also be emitted on the
appropriate class. This can be used for out ewmh stuff, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 18:36:24 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Julien Danjou f523b37e1d lua{class,object}: {add,remove}_signal() take lua_CFunction as arg
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:14:55 +02:00
Julien Danjou 548e5441b1 ewmh: use client signals to call ewmh_update_net_client_list
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:38:17 +02:00
Uli Schlachter 28de7741cd Remove globalconf.screen_focus
This moves the appropriate fields for client focus from screen_t to globalconf
since only the first screen's fields were used anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-17 15:52:49 +02:00
Uli Schlachter 5d35771673 Save the screen in globalconf.
There can only be on xcb_screen_t now, so we can save it in globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:10:58 +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 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
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 da2a7aec0d Fix an unbalanced lua stack operation
ewmh_process_state_atom() does a luaA_object_push() at its beginning, but it
doesn't pop that object again. Fix this by, well, popping the object at the end
of the function again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-03 11:25:54 +02:00
Uli Schlachter e291c03982 Handle _NET_WM_DESKTOP more intelligently
This makes sure that an invalid value for this property doesn't cause the client
to have no tag at all. This should be especially useful when one uses dynamic
tags and restarts awesome which causes less tags to exist than before.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:38 +02:00
Uli Schlachter 65dfdf01ce Remove _NET_WM_DESKTOP when client got no tags
EWMH says that "Window Managers MUST keep this property updated on all windows",
but doesn't say anything about clients which got no desktop at all. Removing the
property seems to be the best we could do.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:38 +02:00
Julien Danjou 61430f860d ewmh: use client signals to update NET_ACTIVE_WINDOW
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:36:35 +02:00
Julien Danjou f4876b5275 ewmh: use signals to update client hints
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:34 +02:00
Julien Danjou 434a6e5275 ewmh: remove useless update_hints calls
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:22 +02:00
Julien Danjou 92717a0849 window: add strut support
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:27:45 +02:00
Julien Danjou 9c020877dd ewmh: remove _NET_WORKAREA support (FS#732)
This fixes problem with Qt 4.6.
Our implementation cannot be standard, and was not standard, so just
stop using this EWMH crap.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-02-18 10:04:01 +01:00