Commit Graph

24 Commits (next)

Author SHA1 Message Date
Orestis Floros c9efa6dffe
Call all ewmh_update_* functions together when necessary
The testcase is changed because it was actually incorrect. Easy to
verify because:
> _NET_CURRENT_DESKTOP
> …
> The index of the current desktop. This is always an integer between 0
> and _NET_NUMBER_OF_DESKTOPS - 1.

Fixes #3696.
Also updates the viewports.

Finally, fixes an issue with _NET_CURRENT_DESKTOP not being updated
after a workspace rename. Example:
- workspaces 1, 2, 3
- rename workspace 1 to 5
- All workspaces changed their index but _NET_CURRENT_DESKTOP was not
updated
2019-05-03 16:19:11 +03:00
Tony Crisci c42de09b1b Support _NET_WM_STATE_FOCUSED
_NET_WM_STATE_FOCUSED is set on _NET_WM_STATE to indicate that the
window is focused. It must be set when the window is newly focused and
removed once the window no longer has focus.

> _NET_WM_STATE_FOCUSED indicates whether the window's decorations are
> drawn in an active state. Clients MUST regard it as a read-only hint.
> It cannot be set at map time or changed via a _NET_WM_STATE client
> message.

For example, this is used by GTK applications to show the decoration in
an active or inactive state. This change can be tested by opening a GTK
application (like evince), focusing the window and unfocusing the
window, and observing a change in the window decorations.

Fixes #2273
2018-03-23 14:30:57 +02:00
Michael Stapelberg d968d39b27 Replace http:// with https:// where applicable
The testcases will be updated automatically in a separate commit.
2017-09-24 10:19:07 +02:00
Michael Stapelberg f354f53435 Ensure all *.[ch] files include config.h
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.

This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly

Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
2016-10-23 21:09:24 +02:00
Ingo Bürk 328035fb7e Handle the EWMH atom _NET_WM_DESKTOP.
We already claim _NET_WM_DESKTOP support in _NET_SUPPORTED since around 2009,
but haven't actually done anything with it. However, especially pagers like
gnome-panel rely on this property to be updated and many tools, like GTK, want
to use the corresponding client messages to make a window sticky, move it
around etc.

This patch implements full support according to the EWMH spec. This means:

* We set the property on all windows when managing it.
* We keep the property updated on all windows at all times.
* We read and respect the property upon managing a window if it was set before
  mapping the window.
* We react to client messages for it.
* We remove the property on withdrawn windows.

Note that the special value 0xFFFFFFFF, according to the spec, means that the
window shall be shown on all workspaces. We do this by making it sticky and
float it. This shows it on all workspaces at least on the output it is on.

Furthermore, the spec gives us the freedom to ignore _NET_WM_DESKTOP when
managing a window if we have good reason to. In our case, we give window
swallowing a higher priority since the user would likely expect that and we
want to keep placeholder windows only around for as long as we have to.
However, we do prioritize this property over, for example, startup
notifications.

fixes #2153
fixes #1507
fixes #938
2016-01-18 12:13:36 +01:00
Ingo Bürk 9866b00802 Implement new 'sticky' command to manually set, remove or toggle the sticky state on a window. 2015-09-13 20:40:20 +02:00
Ingo Bürk f44c87685b Support _NET_WM_VISIBLE_NAME. As per specification this is necessary since we can display custom titles with title_format.
fixes #1872
2015-08-30 22:42:14 +02:00
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
Tony Crisci a9c094b731 Implement EWMH desktop names
Maintain the _NET_DESKTOP_NAMES property on the root window.

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368131760

> _NET_DESKTOP_NAMES
>
> _NET_DESKTOP_NAMES, UTF8_STRING[]
>
> The names of all virtual desktops. This is a list of NULL-terminated
> strings in UTF-8 encoding [UTF8]. This property MAY be changed by a
> Pager or the Window Manager at any time.
2014-06-24 09:04:05 +02:00
Tony Crisci 4205973135 feature: implement ewmh desktop viewport property
Set and update the _NET_DESKTOP_VIEWPORT property

http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140146176862048

> _NET_DESKTOP_VIEWPORT x, y, CARDINAL[][2]/32
> Array of pairs of cardinals that define the top left corner of each
> desktop's viewport.
2014-06-23 21:29:57 +02:00
Tony Crisci b47f480728 Implement EWMH number of desktops property
_NET_NUMBER_OF_DESKTOPS:

> This property SHOULD be set and updated by the Window Manager to
> indicate the number of virtual desktops.

We interpret this property as the number of noninternal workspaces.
2014-06-19 11:21:03 +02:00
Tony Crisci 819bc09375 Maintain the _NET_CLIENT_LIST property
Add and update the _NET_CLIENT_LIST property on the root window to
better comply with ewmh standards.

Information on this property can be found here:
http://standards.freedesktop.org/wm-spec/latest/ar01s03.html

> These arrays contain all X Windows managed by the Window Manager.
> _NET_CLIENT_LIST has initial mapping order, starting with the oldest window.

fixes #1099
2014-04-15 17:44:25 +02:00
Alexander Kedrik e2ebe3e2ae Use #pragma once
#pragma once is safer and simpler. According to Wikipedia it's supported by all major compilers.
2014-01-01 15:06:57 +01:00
Michael Stapelberg eec80838ab actively delete _NET_WORKAREA on startup
fixes #1038
2013-07-13 12:24:15 +02:00
Michael Stapelberg d638e3029a don’t use reversed identifiers for include guards (Thanks Markus)
Done with:

    sed -in 's/\(ifndef\|define\) _\([0-9A-Z_]*\)$/\1 I3_\2/' include/**/*.h

fixes #804
2012-09-21 15:36:25 +02:00
Michael Stapelberg 206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00
Michael Stapelberg 4f26d6f2a1 Bugfix: Setup the _NET_SUPPORTING_WM_CHECK atom in a standards-compliant way
This makes chrome (and probably other apps, too) receive changes of the
_NET_ACTIVE_WINDOW and thus show its bookmark dialog properly.

Fixes: #544
2012-01-20 18:09:53 +00:00
Michael Stapelberg d25e77ce75 Don’t set the _NET_WM_WORKAREA hint at all (Thanks cg)
Fixes: #539
2011-11-30 20:33:07 +00:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg 192dbdabd6 Bugfix: Correctly set the _NET_CLIENT_LIST_STACKING hint (fixes chromium tabbar)
Fixes #287
2011-08-03 20:07:03 +02:00
Fernando Tarlá Cardoso Lemos c0563af3e2 Bring back some more EWMH support. 2011-03-14 17:11:33 +01:00
Michael Stapelberg 75aac5bc02 ewmh: implement support for _NET_WORKAREA (rdesktop can use that)
Please note that rdesktop’s -g workarea option will not work on
64-bit systems at the moment because of a bug in rdesktop (see the
rdesktop-devel mailing list).
2009-12-31 17:48:41 +01:00
Michael Stapelberg e7e9e8e49d ewmh: correctly set _NET_ACTIVE_WINDOW 2009-12-25 15:19:39 +01:00
Michael Stapelberg 0641e6a1a3 ewmh: correctly set _NET_CURRENT_DESKTOP to the number of the active workspace 2009-12-25 15:05:17 +01:00