Commit Graph

29 Commits (04fa40d3e5e11be98a89d5d97c395f95a6d08e37)

Author SHA1 Message Date
Tony Crisci 8d031bfbf8 Handle _NET_CLOSE_WINDOW client message requests
> Pagers wanting to close a window MUST send a _NET_CLOSE_WINDOW client
> message request to the root window.

We interpret this message as a request to close the con for the given
window.

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

fixes #1396
2014-11-17 09:08:42 +01:00
Tony Crisci bb24db1986 Bugfix: _NET_SUPPORTED property fixes
Fix a typing mistake that may cause _NET_SUPPORTED root property to
become corrupted.

This bug was introduced in:

Implement EWMH number of desktops property

http://code.stapelberg.de/git/i3/commit/?h=next&id=b47f480728a6d053c117e4b99ee4c78d99ba6a71

Additionally adds one missing atom to _NET_SUPPORTED.

fixes #1298
2014-07-01 23:43:14 +02: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 8a618e4b00 bugfix: don't set input focus if not accepted
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7

> Clients using the Globally Active model can only use a SetInputFocus request
> to acquire the input focus when they do not already have it on receipt of one
> of the following events:
> * ButtonPress
> * ButtonRelease
> * Passive-grabbed KeyPress
> * Passive-grabbed KeyRelease

Since managing a window happens on a MapNotify (which is absent from this
list), the window cannot accept input focus, so we should not try to focus
the window at all.

Fixes an issue with xfce4-notifyd which (correctly) declines focus when
we send WM_TAKE_FOCUS, which puts i3 in a state where i3 focus and X
focus are different when a notification appears.
2014-06-19 11:55:28 +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
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +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
Steve Jones 0e27ff3cd0 Set EWMH desktop properties on startup.
Calls ewmh_update_current_desktop on startup to set the
_NET_CURRENT_DESKTOP property. Without this change the property only
gets set after the workspaces have been manipulated. Also exclude
hidden workspaces (i.e. those starting with "__" from the workspace
index.

Adds tests for startup and workspace switching.
2014-02-08 20:38:16 +01:00
Michael Stapelberg eec80838ab actively delete _NET_WORKAREA on startup
fixes #1038
2013-07-13 12:24:15 +02:00
oblique 8a4a719093 Add support for _NET_WM_STATE_DEMANDS_ATTENTION.
_NET_WM_STATE_DEMANDS_ATTENTION indicates that some action in or with
the window happened. It's a weaker hint than urgency flag of WM_HINTS,
but some applications and almost all Qt applications use it instead of
WM_HINTS' urgency flag (one example is Skype).
2013-03-09 10:55:13 +01:00
Michael Stapelberg 884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
Michael Stapelberg 0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +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 10d3281b0f remove/shorten a lot of debugging messages
Some of them are useless nowadays, others very unlikely to be a problem.
Those which might still be interesting somewhen in the future are just
commented out.
2011-10-23 00:15:13 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
Michael Stapelberg 7951445849 xcb: use predefined XCB_ATOM_ atoms, don’t request them 2011-08-17 01:41:19 +02: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
Michael Stapelberg 0639a7d95b Make i3 compatible with the very latest xcb
This involves:
 • Compiling with xcb-util instead of xcb-{atom,aux} (they merged the libraries)
 • Not using xcb-{event,property} anymore (code removed upstream)
 • Not using the predefined WINDOW, CARDINEL, … atoms (removed upstream)
 • Using the new xcb_icccm_* data types/functions instead of just xcb_*
   (for example xcb_icccm_get_wm_hints instead of xcb_get_wm_hints)

Also I refactored the atoms to use x-macros.
2011-03-18 14:39:27 +01:00
Michael Stapelberg 01365edb30 ewmh: bump copyright 2011-03-14 17:15:18 +01:00
Michael Stapelberg fb9978b975 ewmh: add comment to describe why we count 2011-03-14 17:15:04 +01:00
Fernando Tarlá Cardoso Lemos c0563af3e2 Bring back some more EWMH support. 2011-03-14 17:11:33 +01:00
Michael Stapelberg 715983024d ewmh: Don’t push workspaces with width=0 and height=0 (Thanks Atsutane, badboy)
Even though i3 cannot know the width/height of some workspaces as
long as they are not initialized (say you used workspace 1 and 3,
but not workspace 2), some applications require this information.
In this case, it was Firefox which intersects the available workareas
(see mozilla/gfx/src/gtk/nsScreenGtk.cpp) and did not position some
windows correctly when being confronted with zero-width/height
workspaces.
2010-01-03 18:36:50 +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