Commit Graph

2530 Commits (3bd5e6e5c81b448f9f0ac84454671a871fbfea66)

Author SHA1 Message Date
Michael Stapelberg 3bd5e6e5c8 refactoring: store modifiers alongside translated keycodes
This is a no-op refactoring in terms of functionality.

related to #2346
2016-08-02 20:10:49 +02:00
Michael Stapelberg 0239c4b6da move xkb_current_group check into own function
This is a no-op refactoring.
2016-08-02 19:33:26 +02:00
Michael Stapelberg afb90a0f97 remove superfluous check for input_type
This condition is already enforced in grab_all_keys().
2016-08-02 19:31:23 +02:00
yshui 3ffa88e54a Don't change border style if BS_NORMAL is requested in motif hints (#2386)
Fixes #2385
2016-06-25 21:35:36 +02:00
yshui 45012189bc Handle _MOTIF_WM_HINTS changes (#2384) 2016-06-22 08:39:25 +02:00
Ingo Bürk b1d70f25b3 Introduced a new GET_BINDING_MODES message type and reply. (#2376)
This type dumps all currently configured binding modes.

fixes #2375
2016-06-15 22:25:22 +02:00
Christopher Zimmermann 1322af1e4f Don't use pthread on OpenBSD
since OpenBSD pthread does not support pthread_condattr_setpshared().
This patch could also stay in the OpenBSD ports tree or depend on a
configure test macro rather than defined __OpenBSD__.
2016-06-11 14:47:26 +02:00
Christopher Zimmermann 87e90229bc Always use socket activation
it neither depends on systemd nor on any linuxism.
2016-06-11 14:47:23 +02:00
Christopher Zimmermann 7e2483edf7 Use 64 bit time_t 2016-06-11 12:58:16 +02:00
Ingo Bürk 18d6a1bc76 Explicitly terminate fallback in set_from_resource. (#2366) 2016-05-31 22:58:23 +02:00
Ingo Bürk 9409c2b2e5 Don't trigger binding on window border click unless --border is given. (#2349)
Prior to this commit a binding specifying only --whole-window would
trigger even when clicking on the window border. However, this should
only happen if --border is specified.

fixes #2348
2016-05-11 20:11:35 +02:00
Julien Lequertier 4bec3b9d24 Smart option added to hide_edge_borders config param (#2191) (#2191)
Use case:

* When managing multiple terminals in a workspace, the borders makes it easier
to know where the focus is, but when there is only one it's obvious where the
focus is.

* When there's only a web browser for example, the borders are actually counter-
productive since it makes clicking a side scrollbar or a tab a bit harder (if I
smash my cursor to the side or the top of the workspace, I have to move it in
the other direction by just a few pixels to be able to grab it)

Behaviour:

* No borders when there's a single window in a workspace
* Borders when there are multiple windows in a workspace

fixes #2188
2016-05-10 20:27:20 +02:00
Ingo Bürk 47562b4143 Introduce support for specifying variables from X resources. (#2286)
This patch introduces a new 'set_from_resource' config directive which
allows defining a variable by retrieving its value from the X resource
database. This avoids having to configure a color scheme in multiple
files. The directive takes an additional fallback value which is used
in case the resource cannot be found or during config validation where
no X connection is available.

Furthermore, this patch includes the following changes:
- If the same variable is defined twice, we now properly overwrite the
  value of the assignment rather than inserting two variable definitions
  with the same key.
- We now depend on xcb-util-xrm to query the resource.
- Increase the buffer size for variable / resource assignments.

fixes #2130
2016-05-08 12:55:27 +02:00
Ingo Bürk dbafb3cf23 Properly close disabled outputs restored during a restart. (#2337)
If an output is disabled during a restart, for example because a binding
such as

    bindsym $mod+Shift+r exec "xrandr --auto", restart

is used, it can happen that we first write the layout to disk and only
then receive the RandR change events. This leads to a situation where
the restored tree will contain these outputs, but the restarted i3
process will not receive the RandR events, thus the internal output in i3
is marked disabled.

This patch finds these cases after a restart and force-disables the
affected outputs.

fixes #2326
2016-05-08 12:49:24 +02:00
Johannes Lange a8757625c3 Do not count '\' in comment as line continuation (#2181)
fixes #2176
2016-05-08 00:20:08 +02:00
Ingo Bürk 6746aa4b5f Use the last known timestamp when calling xcb_set_input_focus(). (#2332)
In most cases this won't make a difference, but consider the following
scenario:

* Some application acquires input focus on its own (which the window manager
  is not involved in, so it will "always" work).
* Before the FocusIn / FocusOut events are processed by i3, the
  workflow to push X changes is run, resulting in xcb_set_input_focus()
  being called.

Using XCB_CURRENT_TIME, this means i3 will "win" and override the focus,
even though it simply wasn't aware (yet) that focus had already been taken
over by someone else. When processing the FocusIn / FocusOut events, i3
assumes that the focus is already set which results in a broken focus
state as i3 assumes some container has the input focus when it doesn't.

With the new behavior, i3's attempt to set the input focus will fail if
the FocusIn / FocusOut events have not yet processed. Once they are processed,
the focus state will be automatically corrected.

fixes #2322
2016-05-05 20:46:33 +02:00
Ingo Bürk b2397c9f01 Remove redundant depth argument from x_con_init(). (#2323) 2016-05-05 14:18:27 +02:00
Ingo Bürk 152318bccf Remove dead code guarded with "#if 0 … #endif" (#2338)
This code has been neutralized for many years now and served no purpose
other than cluttering up the code. We obviously don't need it and it's
out of date anyway.

If there's ever any reason to restore (parts of) it, we have git for
that. But we don't need to keep commented out code around.
2016-05-05 14:18:04 +02:00
Ingo Bürk 3b089d0771 Remove title indentation in nested containers. (#2330)
This commit removes the title indentation in certain nested container
situations. The behavior was considered broken as it didn't seem to
make sense and it was unclear why this was introduced.

Given that nobody on i3-discuss@ complained about removing this logic
within two weeks, we are now removing it to make the title rendering
code a little less complex.

fixes #2247
2016-05-01 18:59:50 +02:00
Kyle Kneitinger 2123888d4d Ensure config variables match on longest-length (#2306)
fixes #2235
2016-04-26 08:20:42 +01:00
Ingo Bürk 23beac46b7 Focus a newly managed container only if it doesn't use the globally active input model. (#2317)
fixes #1784
2016-04-26 08:09:07 +01:00
Ingo Bürk e9798b7e3e Use logical_px() and fix indentation.
relates to #2247
2016-04-15 18:51:20 +02:00
Ingo Bürk 057517b809 Redraw right-hand side border correctly.
Since we don't actually stop drawing a title (or marks) with the
distance of the border width on the right side, but instead with
a hard-coded two pixel distance, we can only redraw that much of
the border without potentiall cutting off text.

relates to #2247
2016-04-15 18:51:20 +02:00
Ingo Bürk c3db74a1f8 Only redraw right-hand side border if a non-pango font is used.
relates to #2247
2016-04-15 18:51:20 +02:00
Tony Crisci e690e3d483 Cast con id as uintptr_t (#2298)
Use `uintptr_t` to cast the con id to int instead of `long int`. This
type is guaranteed to hold the pointer as an int regardless of platform.

fixes #2283
2016-04-15 00:27:43 -07:00
Ingo Bürk 80dddd9961 Correctly count the number of windows for no_focus. (#2296)
Previously we counted the number of (direct) children of the workspace to
decide whether no_focus should be applied or not. However, this doesn't
work correctly if there's a single container with multiple windows on the
workspace.

This patch correctly counts all windows on the workspace.

fixes #2292
2016-04-15 00:26:42 -07:00
Ingo Bürk 83c8740bf1 Only grab the mouse buttons that need to be grabbed. (#2290)
This is a followup to #2049. While we had fixed that bug by only grabbing
buttons 4 and 5 if there is a whole-window binding for that button, this
did not consider buttons higher than 5 as found on many mice.

Therefore, we now ditch the special handling for scrollwheel buttons and
instead do the same for all buttons higher than 3.

fixes #2271
2016-04-13 10:45:57 -07:00
Guillaume Maudoux b52482705e Avoid hazardous casting. 2016-04-11 15:00:47 +02:00
Guillaume Maudoux 8dc7691a6f Remove "dereferencing type-punned pointer" warning
Fix the remaining warning discussed in #1538.
This is obviously a false positive from gcc.
2016-04-11 14:50:01 +02:00
wentasah fec1a9511e Make fullscreen windows open on the output which is indicated by their geometry
With this change, multi-monitor presentations (e.g. as implemented by
LibreOffice Impress) work out of the box. Previously, one had to move
the presentation windows to the right outputs oneself.
2016-04-06 21:19:10 +02:00
Eric Engeström 66d9c983e4 Fix spelling mistakes 2016-04-04 09:33:59 +02:00
Kacper Kowalik (Xarthisius) 301320585e Add missing MAX macros, ensure that i3 can be compiled without pango 2016-03-23 10:58:10 -05:00
Marcin Szewczyk ad36e32764 window_update_motif_hints(): uint32_t for fields, fixes #2238
xcb_get_property_value() returns 32-bit property fields
2016-03-02 23:31:08 +01:00
Michael Stapelberg 6fe8d30d65 Merge pull request #2233 from Airblader/bug-2228
Revert to default binding mode before reloading the config.
2016-02-25 21:19:14 +01:00
Michael Stapelberg 70cc9af69b Merge pull request #2232 from Airblader/bug-2229
Determine focused workspace correctly when moving workspace to output.
2016-02-25 21:18:55 +01:00
Ingo Bürk ad702dff13 Revert to default binding mode before reloading the config.
If a user reloads the config while in some binding mode, the binding mode
will revert to the default, but no event will ever be fired, causing a
broken i3bar mode display.

This patch explicitly reverts to the default binding mode before reloading
the config. We reload rather than switch to the binding mode after having
reloaded the config because there's no guarantee that mode will even still
exist.

fixes #2228
2016-02-25 19:28:48 +01:00
Ingo Bürk a9d8184c73 Determine focused workspace correctly when moving workspace to output.
This patch correctly determines the previously focused workspace on the
target output when moving a workspace to another output. Before, we used
nodes_head for this, which will not actually return the previously focused
workspace, but just the first workspace on that output. Hence, we now use
focus_head instead.

This bug was introduced all the way back in 1e143fea when the feature of
moving workspaces to another output was first implemented.

fixes #2229
2016-02-25 19:12:09 +01:00
Ingo Bürk 712c6d65ff Introduce I3_FLOATING_WINDOW
This patch introduces a proprietary atom I3_FLOATING_WINDOW which will be
set and maintained for floating windows and removed on tiling containers.

This allows users to select on this atom, e.g., in their compositor
configuration or in utility scripts (without using the IPC).

fixes #2223
2016-02-25 18:36:22 +01:00
Michael Stapelberg fdbbae56b2 split atoms.xmacro into 2 files to obtain _NET_SUPPORTED count
Manually updating a magic number doesn’t work in the long run.
With this change, the number of atoms contained in
include/atoms_NET_SUPPORTED.xmacro is used.

fixes #2230
2016-02-23 21:48:18 +01:00
Michael Stapelberg f63701ed09 Allow workspace renames which change case
fixes #2211
2016-02-15 08:34:03 +01:00
Michael Stapelberg e91fa09569 Merge pull request #2210 from Airblader/bug-2166
Don't allow floating workspaces anymore.
2016-02-15 08:15:23 +01:00
Ingo Bürk 9431ef16f6 Don't allow floating workspaces anymore.
This is essentially a revert of daf00a9 which introduced a mechanism
to float workspace containers by wrapping all children into a new
container and floating it.

This caused a bug and there's no good reason (anymore) to allow doing
this in the first place as we don't support floating nested containers.

fixes #2166
2016-02-11 21:25:50 +01:00
Ingo Bürk 018922dcc4 Allow "modifier none" in i3bar to disable the modifier.
This allows "modifier none" (and "modifier off") for the bar config
in order to disable the modifier key altogether. This is useful
for users who use a different approach to hiding / showing the bar,
e.g., a custom keybind that involved multiple keys or scripts.

fixes #2208
2016-02-11 20:51:05 +01:00
Ingo Bürk 6cbff6bfd4 Ensure that the "border" command uses logical pixels.
Until now, only the config directive for borders (new_window,
new_float) respected the DPI setting (using logical_px). This
patch makes sure we also do so for runtime "border" commands.

fixes #2202
2016-02-09 21:03:44 +01:00
Ingo Bürk ad95038c5e Remove _NET_WM_STATE on withdrawn windows.
According to the spec, _NET_WM_STATE must be removed when the window is
withdrawn, much like _NET_WM_DESKTOP.

fixes #2165
2016-02-07 12:08:50 +01:00
Michael Stapelberg fbfbdb8e12 travis: check spelling of binaries and manpages, use docker
We now build a docker base container based on debian sid (where the very
latest packages are available). That base container is updated once a
month, or whenever travis-build.Dockerfile or debian/control change, but
re-used for subsequent travis runs. While the initial build might take
up to 15 minutes, subsequent builds typically run in a minute or two.

All the different steps that we run on travis are now factored into
separate scripts in the travis/ directory.

Switching to docker should also help with issue #2174.
2016-02-06 10:36:43 +01:00
David Coppa 1041572769 Remove commented-out code. 2016-01-26 09:55:24 +01:00
Ingo Bürk 3c0ba081df Don't ignore focus on _NET_WM_DESKTOP client messages.
Ignoring the focus leads to a broken focus if the pointer is, e.g.,
over i3bar at the point in time the window is moved by the client
message. It also causes i3bar's workspace display to break.

Thanks to GermainZ for reporting.
2016-01-22 20:32:51 +01:00
Ingo Bürk 95b60b170e Don't grab the buttons on the root window.
We don't actually need to grab the buttons to fix #2097, but doing so
will cause a freeze due to unreleased events.

We partially revert 6f12f02 which avoids the freeze, but doesn't break
functionality.

relates to #2097
fixes #2168
2016-01-20 22:28:20 +01:00
Michael Stapelberg cfd07ab0e6 Merge pull request #2162 from Airblader/feature-2153
Handle the EWMH atom _NET_WM_DESKTOP.
2016-01-18 13:31:03 -08:00