]> git.sur5r.net Git - i3/i3/log
i3/i3
6 years agoMerge pull request #3307 from orestisf1993/link
Ingo Bürk [Thu, 7 Jun 2018 20:52:05 +0000 (22:52 +0200)]
Merge pull request #3307 from orestisf1993/link

Fix link

6 years agoFix link 3307/head
Orestis Floros [Thu, 7 Jun 2018 20:07:16 +0000 (23:07 +0300)]
Fix link

Equivalent from the same version:
https://cgit.freedesktop.org/xorg/xserver/tree/xkb/xkbEvents.c?h=xorg-server-1.17.2#n927

6 years agoMerge pull request #3303 from orestisf1993/back_and_forth
Ingo Bürk [Sat, 2 Jun 2018 15:17:15 +0000 (17:17 +0200)]
Merge pull request #3303 from orestisf1993/back_and_forth

docs: link workspace_auto_back_and_forth from workspace command

6 years agodocs: link workspace_auto_back_and_forth from workspace command 3303/head
Orestis Floros [Sat, 2 Jun 2018 14:58:10 +0000 (17:58 +0300)]
docs: link workspace_auto_back_and_forth from workspace command

The current text is confusing. '--no-auto-back-and-forth' doesn't
disable the 'workspace back_and_forth' command, the flag is not even
valid for that command.

6 years agoMerge pull request #3301 from Streetwalrus/swallow-reframe
Ingo Bürk [Sat, 2 Jun 2018 12:51:18 +0000 (14:51 +0200)]
Merge pull request #3301 from Streetwalrus/swallow-reframe

Reframe swallowed windows if depth doesn't match

6 years agoReframe swallowed windows if depth doesn't match 3301/head
Dan Elkouby [Fri, 1 Jun 2018 15:55:35 +0000 (18:55 +0300)]
Reframe swallowed windows if depth doesn't match

X will not allow a window with ParentRelative background to be created
or reparented under a window with mismatching color depth.
Deal with this by destroying the container frame and creating a new one
with the right depth upon swallowing.
Defer destruction of the frame window until after the updated tree has
been rendered to avoid some distracting flickering.

Fixes #3297

6 years agoUpdated ISSUE_TEMPLATE.md (#3295)
Ingo Bürk [Sun, 20 May 2018 14:51:26 +0000 (16:51 +0200)]
Updated ISSUE_TEMPLATE.md (#3295)

6 years agoMerge pull request #3282 from orestisf1993/strncpy-to-memcpy
Ingo Bürk [Wed, 9 May 2018 12:34:00 +0000 (14:34 +0200)]
Merge pull request #3282 from orestisf1993/strncpy-to-memcpy

Replace strncpy call with memcpy when result is not NUL-terminated

6 years agoReplace strncpy call with memcpy when result is not NUL-terminated 3282/head
Orestis Floros [Tue, 8 May 2018 14:05:46 +0000 (17:05 +0300)]
Replace strncpy call with memcpy when result is not NUL-terminated

This fixes a new warning from GCC 8.1, -Wstringop-truncation:
https://gcc.gnu.org/gcc-8/changes.html
https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wstringop-truncation

Replacing with memcpy is what gcc suggests:
> As another example, the following call to strncpy results in copying
> to d just the characters preceding the terminating NUL, without
> appending the NUL to the end. Assuming the result of strncpy is
> necessarily a NUL-terminated string is a common mistake, and so the
> call is diagnosed. To avoid the warning when the result is not
> expected to be NUL-terminated, call memcpy instead.
>    void copy (char *d, const char *s)
>    {
>      strncpy (d, s, strlen (s));
>    }

6 years agoMerge pull request #3279 from Streetwalrus/next
Orestis [Sat, 5 May 2018 10:49:13 +0000 (13:49 +0300)]
Merge pull request #3279 from Streetwalrus/next

Activate the focused child when scrolling over tab/stack decorations

6 years agoActivate the focused child when scrolling over tab/stack decorations 3279/head
Dan Elkouby [Sat, 5 May 2018 10:30:48 +0000 (13:30 +0300)]
Activate the focused child when scrolling over tab/stack decorations

fbce834b introduced a bug where scrolling over the decoration while
another container is focused would not focus the tabbed/stacked
container itself, but would instead move focus through the currently
focused container.

6 years agoMerge pull request #3272 from orestisf1993/fake-outputs
Ingo Bürk [Fri, 4 May 2018 19:58:01 +0000 (21:58 +0200)]
Merge pull request #3272 from orestisf1993/fake-outputs

Fix: ConfigureNotify can crash i3 with fake-outputs

6 years agoMerge pull request #3277 from orestisf1993/resize-set
Ingo Bürk [Fri, 4 May 2018 19:57:12 +0000 (21:57 +0200)]
Merge pull request #3277 from orestisf1993/resize-set

Resize set improvements

6 years agoresize set: accept 'width' and 'height' keywords 3277/head
Orestis Floros [Wed, 2 May 2018 15:59:17 +0000 (18:59 +0300)]
resize set: accept 'width' and 'height' keywords

Fixes #3275

6 years agoresize set for floating: interpret 0 as 'no change'
Orestis Floros [Wed, 2 May 2018 14:43:43 +0000 (17:43 +0300)]
resize set for floating: interpret 0 as 'no change'

Fixes #3276

6 years ago252-floating-size.t: Reduce code duplication
Orestis Floros [Wed, 2 May 2018 15:06:48 +0000 (18:06 +0300)]
252-floating-size.t: Reduce code duplication

6 years agoMerge pull request #3274 from orestisf1993/DEPENDS
Ingo Bürk [Tue, 1 May 2018 17:13:08 +0000 (19:13 +0200)]
Merge pull request #3274 from orestisf1993/DEPENDS

Fix DEPENDS table

6 years agoFix DEPENDS table 3274/head
Orestis Floros [Tue, 1 May 2018 10:49:55 +0000 (13:49 +0300)]
Fix DEPENDS table

- Align right border
- Add a missing '/' in libsn's and util-xrm's link for consistency
- Replace wrong character for border next to pango's min version
- Correct the Pod::Simple link

6 years agoDon't refocus a workspace cleaned up by `workspace_show` during rename
Oliver Graff [Tue, 1 May 2018 08:25:13 +0000 (04:25 -0400)]
Don't refocus a workspace cleaned up by `workspace_show` during rename

When moving a workspace to the current output by way of a rename, if the
current workspace is empty, it will be removed by `workspace_show`.
Attempting to restore focus to this removed workspace causes a crash.
Follow the pattern in workspace.c:996 to only restore the original focus if the
original workspace still exists.

Add a test to ensure that the renamed workspace moves to its appropriate
output and that a crash does not occur.

Fixes #3228

6 years agoMerge pull request #3270 from orestisf1993/ADD_TRANSLATED_KEY
Ingo Bürk [Mon, 30 Apr 2018 08:02:34 +0000 (10:02 +0200)]
Merge pull request #3270 from orestisf1993/ADD_TRANSLATED_KEY

Define ADD_TRANSLATED_KEY once

6 years agoFix: ConfigureNotify can crash i3 with fake-outputs 3272/head
Orestis Floros [Mon, 30 Apr 2018 00:54:38 +0000 (03:54 +0300)]
Fix: ConfigureNotify can crash i3 with fake-outputs

handle_screen_change() and handle_configure_notify() call
randr_query_outputs() where root_output is not initialized because
randr_init() is never called when config.fake_outputs is not NULL.

6 years agosend_tick: set "first" field (#3271)
Orestis [Sat, 28 Apr 2018 12:47:28 +0000 (15:47 +0300)]
send_tick: set "first" field (#3271)

According to the docs, the tick event should return:
    {
     "first": false,
     "payload": "arbitrary string"
    }

6 years agoDefine ADD_TRANSLATED_KEY once 3270/head
Orestis Floros [Sat, 28 Apr 2018 09:21:39 +0000 (12:21 +0300)]
Define ADD_TRANSLATED_KEY once

6 years agoMerge pull request #3268 from orestisf1993/janitorial
Ingo Bürk [Fri, 27 Apr 2018 09:14:45 +0000 (11:14 +0200)]
Merge pull request #3268 from orestisf1993/janitorial

Janitorial

6 years agoMerge pull request #3267 from orestisf1993/cmd_shmlog
Ingo Bürk [Fri, 27 Apr 2018 06:38:29 +0000 (08:38 +0200)]
Merge pull request #3267 from orestisf1993/cmd_shmlog

cmd_shmlog: use parse_long()

6 years agomain.c: remove redundant 'focused' declaration 3268/head
Orestis Floros [Thu, 26 Apr 2018 22:16:42 +0000 (01:16 +0300)]
main.c: remove redundant 'focused' declaration

Previously declared in tree.h:17.

6 years agoFix redundant casts to the same type
Orestis Floros [Thu, 26 Apr 2018 21:08:58 +0000 (00:08 +0300)]
Fix redundant casts to the same type

Found using clang-tidy's google-readability-casting.

6 years agoFix redundant return statements
Orestis Floros [Thu, 26 Apr 2018 20:58:42 +0000 (23:58 +0300)]
Fix redundant return statements

… at the end of a function with a void return type.

Found using clang-tidy's readability-redundant-control-flow.

6 years agocmd_shmlog: use parse_long() 3267/head
Orestis Floros [Thu, 26 Apr 2018 20:47:45 +0000 (23:47 +0300)]
cmd_shmlog: use parse_long()

6 years agoMerge pull request #3261 from orestisf1993/swap-3259
Ingo Bürk [Sun, 22 Apr 2018 14:35:25 +0000 (16:35 +0200)]
Merge pull request #3261 from orestisf1993/swap-3259

Don't call con_fullscreen_permits_focusing with ignore_focus

6 years agoDon't call con_fullscreen_permits_focusing with ignore_focus 3261/head
Orestis Floros [Sun, 22 Apr 2018 00:26:51 +0000 (03:26 +0300)]
Don't call con_fullscreen_permits_focusing with ignore_focus

When we don't modify the focus we aren't risking giving focus to a
container behind the current fullscreen one.

_con_move_to_con can with ignore_focus is called through the swap
command or through con_move_to_workspace for floating containers. This
change shouldn't break the expectations of the callers there.

Fixes issue #3259.

6 years agocon_swap: exit when first _con_move_to_con fails
Orestis Floros [Sun, 22 Apr 2018 00:48:50 +0000 (03:48 +0300)]
con_swap: exit when first _con_move_to_con fails

This is enough to fix the crash discussed in #3259 even though the next
commit can fix it independently. This commit is useful because it
generally makes sense to abort the command when the first call to
_con_move_to_con fails.

6 years agoMerge pull request #3230 from hwangcc23/fix-3227
Ingo Bürk [Sat, 21 Apr 2018 15:57:54 +0000 (17:57 +0200)]
Merge pull request #3230 from hwangcc23/fix-3227

Make "scratchpad show" return correct info

6 years agoMerge pull request #3256 from orestisf1993/REQUIRED_OPTION
Ingo Bürk [Sat, 21 Apr 2018 15:56:06 +0000 (17:56 +0200)]
Merge pull request #3256 from orestisf1993/REQUIRED_OPTION

Remove obsolete macro REQUIRED_OPTION

6 years agoMerge pull request #3260 from orestisf1993/cmd_border
Ingo Bürk [Sat, 21 Apr 2018 15:55:51 +0000 (17:55 +0200)]
Merge pull request #3260 from orestisf1993/cmd_border

cmd_border: improve width selection

6 years agocmd_border: improve width selection 3260/head
Orestis Floros [Sat, 21 Apr 2018 12:21:04 +0000 (15:21 +0300)]
cmd_border: improve width selection

- 'border toggle' now accepts an optional pixel argument which will be
ignored when switching to BS_NONE.
- 'border pixel' now defaults to 1 pixel instead of 2.
- Calling 'border normal' or 'border pixel' will use the configured
default_border_width if one exists. Also applies to floating windows.

6 years agoMake "scratchpad show" return correct info 3230/head
hwangcc23 [Fri, 6 Apr 2018 16:00:38 +0000 (00:00 +0800)]
Make "scratchpad show" return correct info

Fix the issue #3227(https://github.com/i3/i3/issues/3227).

1).Make cmd_scratchpad_show() use the information coming from scratchpad_show().
2).Add a test case 298-scratchpad-show.t.

6 years agoRemove obsolete macro REQUIRED_OPTION 3256/head
Orestis Floros [Fri, 20 Apr 2018 10:00:44 +0000 (13:00 +0300)]
Remove obsolete macro REQUIRED_OPTION

Was used for the removed option 'terminal' and for 'font'. 'font' is no
longer this aggressive and doesn't use the macro.

Killing i3 when an option is missing would be super backwards
incompatible so I doubt we are going to use this ever again.

6 years agoMerge pull request #3255 from orestisf1993/FOR_TABLE
Ingo Bürk [Fri, 20 Apr 2018 03:30:51 +0000 (05:30 +0200)]
Merge pull request #3255 from orestisf1993/FOR_TABLE

Remove obsolete macro FOR_TABLE

6 years agoRemove obsolete macro FOR_TABLE 3255/head
Orestis Floros [Fri, 20 Apr 2018 03:13:40 +0000 (06:13 +0300)]
Remove obsolete macro FOR_TABLE

Was added in 38c8541807d50e18bf5ea61995ec6b3ab3e8a068, should have been
removed in c145f7e5297ef06aaf84689762a736d5bc8cbb83.

6 years agoMerge pull request #3253 from stapelberg/sync
Orestis [Thu, 19 Apr 2018 18:20:44 +0000 (21:20 +0300)]
Merge pull request #3253 from stapelberg/sync

Makefile.am: add forgotten include/sync.h

6 years agoMakefile.am: add forgotten include/sync.h 3253/head
Michael Stapelberg [Thu, 19 Apr 2018 18:10:54 +0000 (20:10 +0200)]
Makefile.am: add forgotten include/sync.h

6 years agoMerge pull request #3250 from rtgnx/next
Ingo Bürk [Wed, 18 Apr 2018 20:30:22 +0000 (22:30 +0200)]
Merge pull request #3250 from rtgnx/next

docs/ipc: update tree node with window_properties

6 years agodocs/ipc: update tree node with window_properties 3250/head
Adrian Cybulski [Wed, 18 Apr 2018 00:46:59 +0000 (01:46 +0100)]
docs/ipc: update tree node with window_properties

6 years agoMerge pull request #3246 from orestisf1993/bar-modifier-3234
Ingo Bürk [Tue, 17 Apr 2018 11:13:18 +0000 (13:13 +0200)]
Merge pull request #3246 from orestisf1993/bar-modifier-3234

i3bar: make modifier behave like floating_modifier

6 years agoi3bar: make modifier behave like floating_modifier 3246/head
Orestis Floros [Mon, 16 Apr 2018 18:10:10 +0000 (21:10 +0300)]
i3bar: make modifier behave like floating_modifier

Pressed modifiers are determined like in click.c:handle_button_press.

Fixes #3234.

6 years agoMerge pull request #3244 from orestisf1993/issue-3220
Ingo Bürk [Mon, 16 Apr 2018 09:59:49 +0000 (11:59 +0200)]
Merge pull request #3244 from orestisf1993/issue-3220

i3bar: don't reset verbosity when parsing config values

6 years agoi3bar: don't reset verbosity when parsing config values 3244/head
Orestis Floros [Sun, 15 Apr 2018 22:37:18 +0000 (01:37 +0300)]
i3bar: don't reset verbosity when parsing config values

When i3bar is called with the -V flag but there is no 'verbose yes'
directive in the bar {} config, the verbosity config value is reset.

This will introduce the opposite, negligible issue: you can't disable
i3bar's verbosity by deleting the 'verbose yes' directive in the bar {}
config. To fix this we would need an enum for config.verbose.

Closes #3220.

6 years agoMerge pull request #3243 from avindra/next
Ingo Bürk [Sun, 15 Apr 2018 19:43:52 +0000 (21:43 +0200)]
Merge pull request #3243 from avindra/next

man: Fix title markers

6 years agoman: Fix title markers 3243/head
Takashi Iwai [Sun, 15 Apr 2018 19:33:55 +0000 (15:33 -0400)]
man: Fix title markers

The title marker lines have to be aligned with the previous lines.
The error was caught by asciidoctor, which tends to be picker than
asciidoc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
6 years agoMerge pull request #3236 from hwangcc23/fix-3220
Ingo Bürk [Sat, 14 Apr 2018 12:39:54 +0000 (14:39 +0200)]
Merge pull request #3236 from hwangcc23/fix-3220

Add an i3bar flag: --verbose

6 years agoAdd an i3bar flag: --verbose 3236/head
hwangcc23 [Tue, 10 Apr 2018 14:20:42 +0000 (22:20 +0800)]
Add an i3bar flag: --verbose

Fix the issue #3220. (https://github.com/i3/i3/issues/3220)

6 years agoMerge pull request #3231 from orestisf1993/target-is-a-workspace
Ingo Bürk [Sat, 7 Apr 2018 19:13:41 +0000 (21:13 +0200)]
Merge pull request #3231 from orestisf1993/target-is-a-workspace

Fix crash when moving container to marked workspace

6 years agoFix crash when moving container to marked workspace 3231/head
Orestis Floros [Sat, 7 Apr 2018 18:43:29 +0000 (21:43 +0300)]
Fix crash when moving container to marked workspace

Was a small typo.

This also has the (positive) side-effect of allowing to move all the
content of a marked workspace next to the target container, see added
tests.

6 years agoMerge pull request #3223 from orestisf1993/minor
Ingo Bürk [Thu, 5 Apr 2018 08:59:34 +0000 (10:59 +0200)]
Merge pull request #3223 from orestisf1993/minor

Minor changes

6 years agoMerge pull request #3221 from ograff/issue-3208
Orestis [Thu, 5 Apr 2018 08:32:38 +0000 (11:32 +0300)]
Merge pull request #3221 from ograff/issue-3208

Issue #3208

6 years agoWorkspace renaming: Interpret outputs as nondirectional 3221/head
Oliver Graff [Sat, 31 Mar 2018 19:56:59 +0000 (15:56 -0400)]
Workspace renaming: Interpret outputs as nondirectional

Currently when renaming outputs, an output assignment of "left" will
cause the workspace to move left. Treat this assignment as a proper name
instead (even though it is unlikely an output will be named "left").

Move logic for determining output to move to out of
`workspace_move_to_output`

Add test for ignoring direcionality during rename.

Fixes #3208.

6 years agoPrefer compiler warnings to assertions for unhandled switch cases 3223/head
Orestis Floros [Wed, 4 Apr 2018 15:12:44 +0000 (18:12 +0300)]
Prefer compiler warnings to assertions for unhandled switch cases

Using 'default:' cases can hide logical errors which would lead to i3
crashes for users. With this change the compiler will print a warning
when a case is not handled. For example, if I add a new value in the
Font.type enum:
../../i3/libi3/font.c: In function ‘draw_text’:
../../i3/libi3/font.c:378:5: warning: enumeration value ‘NEWFONT’ not handled in switch [-Wswitch]
     switch (savedFont->type) {
     ^~~~~~

6 years agoA__NET_REQUEST_FRAME_EXTENTS: use render_font_height()
Orestis Floros [Wed, 4 Apr 2018 15:09:34 +0000 (18:09 +0300)]
A__NET_REQUEST_FRAME_EXTENTS: use render_font_height()

6 years agoMerge pull request #3215 from orestisf1993/focus-next-prev
Ingo Bürk [Tue, 3 Apr 2018 18:42:00 +0000 (20:42 +0200)]
Merge pull request #3215 from orestisf1993/focus-next-prev

Small window decoration scrolling bugfix

6 years agoUse con_orientation instead of ternary operator 3215/head
Orestis Floros [Sat, 31 Mar 2018 23:11:29 +0000 (02:11 +0300)]
Use con_orientation instead of ternary operator

6 years agoWindow decoration scrolling: don't focus sibling
Orestis Floros [Sat, 31 Mar 2018 23:02:50 +0000 (02:02 +0300)]
Window decoration scrolling: don't focus sibling

The current behaviour is buggy in the following layout:
T [ A* V [ B C ] ], where the focus stack in V is B > C.
When the user scrolls down, focus correctly moves to B but if the user
scrolls down again the whole vertical container is focused.

This happens because 'bool scroll_next_possible' is false but
con_activate is called on the tabbed container's sibling - the vertical
container.

6 years agoMerge pull request #2941 from orestisf1993/issue-2938
Ingo Bürk [Sat, 31 Mar 2018 18:34:17 +0000 (20:34 +0200)]
Merge pull request #2941 from orestisf1993/issue-2938

Fix focus order in floating_disable & floating_enable for unfocused windows

6 years agoMerge pull request #3214 from stapelberg/sync
Ingo Bürk [Fri, 30 Mar 2018 19:33:03 +0000 (21:33 +0200)]
Merge pull request #3214 from stapelberg/sync

unflake t/525-i3bar-mouse-bindings.t

6 years agot/525-i3bar-mouse-bindings.t: sync with i3 _and_ i3bar 3214/head
Michael Stapelberg [Fri, 30 Mar 2018 19:08:35 +0000 (21:08 +0200)]
t/525-i3bar-mouse-bindings.t: sync with i3 _and_ i3bar

See the comment in the code for rationale.

6 years agoi3bar: forward the sync request via IPC, not X11
Michael Stapelberg [Fri, 30 Mar 2018 19:07:48 +0000 (21:07 +0200)]
i3bar: forward the sync request via IPC, not X11

i3bar’s X11 output is not what our testcases are testing — the state
manipulations which i3bar triggers via IPC messages to i3 are what we are
interested in.

6 years agointroduce the sync IPC command
Michael Stapelberg [Fri, 30 Mar 2018 19:06:18 +0000 (21:06 +0200)]
introduce the sync IPC command

Sending the sync command via IPC ensures pending IPC messages are handled by i3
before the sync response is read. This is rarely useful for direct IPC
connections to i3, but becomes useful when synchronizing with i3bar, which might
have pending IPC messages in response to button clicks.

6 years agomove i3 sync code into sync_respond (for following commits)
Michael Stapelberg [Fri, 30 Mar 2018 19:05:32 +0000 (21:05 +0200)]
move i3 sync code into sync_respond (for following commits)

6 years agoRemove special handling of floating containers in con_next_focused 2941/head
Orestis Floros [Mon, 25 Sep 2017 11:00:43 +0000 (14:00 +0300)]
Remove special handling of floating containers in con_next_focused

Explanation for the changed test:
After $third is switched to floating, the test moves focus to $second.
So, the parent of $second (the stacked container) is above $third in the
focus stack and it's children ($first, $second) should get focused
before $second. When $second is switched to floating the correct focus
order for the workspace should be $second->parent (floating con is the
parent) > $first->parent (stacked con) > $third.

Fixes #1975

6 years agoAdd testcases for toggling floating windows from different workspaces
Orestis Floros [Thu, 14 Sep 2017 23:29:08 +0000 (02:29 +0300)]
Add testcases for toggling floating windows from different workspaces

6 years agoFix focus order in floating_enable for unfocused windows
Orestis Floros [Thu, 14 Sep 2017 10:00:14 +0000 (13:00 +0300)]
Fix focus order in floating_enable for unfocused windows

Partially fixes issue #2938

6 years agoFix focus order in floating_disable for unfocused windows
Orestis Floros [Wed, 13 Sep 2017 00:54:40 +0000 (03:54 +0300)]
Fix focus order in floating_disable for unfocused windows

Partially fixes issue #2938

6 years agoUse con_detach instead of TAILQ_REMOVE in floating
Orestis Floros [Thu, 14 Sep 2017 09:16:19 +0000 (12:16 +0300)]
Use con_detach instead of TAILQ_REMOVE in floating

6 years agoAdd --modifier flag to i3-config-wizard (#3210)
Joona [Fri, 30 Mar 2018 10:57:41 +0000 (03:57 -0700)]
Add --modifier flag to i3-config-wizard (#3210)

Add --modifier flag to i3-config-wizard

The --modifier flag accepts either alt or win, and will generate the
configuration file without opening a window.

Also adds i3-config-wizard's flags to the manpage.

Fixes #3136.

6 years agoMerge pull request #3213 from orestisf1993/issue-2535
Ingo Bürk [Fri, 30 Mar 2018 10:48:12 +0000 (12:48 +0200)]
Merge pull request #3213 from orestisf1993/issue-2535

Fix memory leak when _XKB_RULES_NAMES can't be found

6 years agoFix memory leak when _XKB_RULES_NAMES can't be found 3213/head
Orestis Floros [Thu, 29 Mar 2018 14:42:58 +0000 (17:42 +0300)]
Fix memory leak when _XKB_RULES_NAMES can't be found

Steps to reproduce:

1. Force the branch to be taken:

diff --git a/src/bindings.c b/src/bindings.c
index fe77bc8f..caa5848c 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -941,7 +941,7 @@ bool load_keymap(void) {

     struct xkb_keymap *new_keymap = NULL;
     int32_t device_id;
-    if (xkb_supported && (device_id = xkb_x11_get_core_keyboard_device_id(conn)) > -1) {
+    if (0) {
         if ((new_keymap = xkb_x11_keymap_new_from_device(xkb_context, conn, device_id, 0)) == NULL) {
             ELOG("xkb_x11_keymap_new_from_device failed\n");
             return false;

2. Run `python2 ./xproperty.py _XKB_RULES_NAMES ''` (from
https://github.com/siemer/xproperty) in the xinitrc
3. Memory sanitizers detect memory leaks.

Note: We don't (and didn't) pass NULL in xkb_keymap_new_from_names() but
an xkb_rule_names structures with NULL fields (fill_rmlvo_from_root only
fills its argument when there are no errors) should be equivalent:
https://github.com/xkbcommon/libxkbcommon/blob/767fa86d42a5e25e7043622d189247e02a5ca379/NEWS#L349-L351
> The function xkb_keymap_new_from_names() now accepts a NULL value for
the 'names' parameter, instead of failing. This is equivalent to passing
a 'struct xkb_rule_names' with all fields set to NULL.

Fixes #2535.

6 years agoMerge pull request #3200 from orestisf1993/_con_move_to_con
Ingo Bürk [Thu, 29 Mar 2018 10:06:29 +0000 (12:06 +0200)]
Merge pull request #3200 from orestisf1993/_con_move_to_con

_con_move_to_con: don't change focus when moving to active workspace

6 years agoMerge pull request #3207 from orestisf1993/get_workspace_by_
Ingo Bürk [Thu, 29 Mar 2018 10:06:05 +0000 (12:06 +0200)]
Merge pull request #3207 from orestisf1993/get_workspace_by_

Introduce get_workspace_by_* functions

6 years agoMerge pull request #3192 from Exagone313/next
Orestis [Thu, 29 Mar 2018 09:16:12 +0000 (12:16 +0300)]
Merge pull request #3192 from Exagone313/next

translate_keysyms: fix potential memory leak

6 years agoIntroduce get_existing_workspace_by_num 3207/head
Orestis Floros [Tue, 27 Mar 2018 19:36:51 +0000 (22:36 +0300)]
Introduce get_existing_workspace_by_num

6 years agoIntroduce get_existing_workspace_by_name
Orestis Floros [Tue, 27 Mar 2018 19:18:17 +0000 (22:18 +0300)]
Introduce get_existing_workspace_by_name

6 years ago_con_move_to_con: don't change focus when moving to active workspace 3200/head
Orestis Floros [Sun, 25 Mar 2018 01:45:19 +0000 (04:45 +0300)]
_con_move_to_con: don't change focus when moving to active workspace

Seems to be the intention, indicated by this comment (con.c:1307-1309):
    /* For split containers, we use the currently focused container within it.
     * This allows setting marks on, e.g., tabbed containers which will move
     * con to a new tab behind the focused tab. */

Related to #3085.

6 years agoFix potential memory leak 3192/head
Elouan Martinet [Tue, 20 Mar 2018 13:06:17 +0000 (13:06 +0000)]
Fix potential memory leak

xkb_state_new uses calloc and may fail in a rare case, which would cause a memory leak.
Note that xkb_state_unref checks if the parameter given is not null (!state) before freeing.
Calls to xkb_state_new have been grouped to remove code duplication.

Signed-off-by: Elouan Martinet <exa@elou.world>
6 years agoMerge pull request #3205 from orestisf1993/free
Ingo Bürk [Tue, 27 Mar 2018 07:02:28 +0000 (09:02 +0200)]
Merge pull request #3205 from orestisf1993/free

cmd_append_layout: resolve_tilde already allocates memory

6 years agocmd_append_layout: resolve_tilde already allocates memory 3205/head
Orestis Floros [Tue, 27 Mar 2018 00:36:54 +0000 (03:36 +0300)]
cmd_append_layout: resolve_tilde already allocates memory

Fixes a small memory leak with all append_layout commands.

6 years agoMerge pull request #3204 from orestisf1993/focus_next
Ingo Bürk [Mon, 26 Mar 2018 19:35:12 +0000 (21:35 +0200)]
Merge pull request #3204 from orestisf1993/focus_next

_con_move_to_con: focus_next isn't always con_next_focused(con)

6 years agoxcb_drag_prepare_cb: drain events (#3193)
Orestis [Mon, 26 Mar 2018 15:59:34 +0000 (18:59 +0300)]
xcb_drag_prepare_cb: drain events (#3193)

As discussed in PR #3085, X11 events can appear while
dragloop->callback() is running.

Co-authored-by: Michael Stapelberg <michael@stapelberg.de>
6 years ago_con_move_to_con: focus_next isn't always con_next_focused(con) 3204/head
Orestis Floros [Sun, 25 Mar 2018 19:29:00 +0000 (22:29 +0300)]
_con_move_to_con: focus_next isn't always con_next_focused(con)

con_next_focused uses con's parent. But since con can be inside an
unfocused container this means that one of it's siblings could become
focused in the current workspace.

6 years agoMerge pull request #3203 from orestisf1993/free
Ingo Bürk [Sun, 25 Mar 2018 18:12:16 +0000 (20:12 +0200)]
Merge pull request #3203 from orestisf1993/free

memory leaks

6 years agocon_toggle_layout: free(tm_dup) outside loop 3203/head
Orestis Floros [Sun, 25 Mar 2018 17:48:20 +0000 (20:48 +0300)]
con_toggle_layout: free(tm_dup) outside loop

6 years agoFree A_TO_WORKSPACE_NUMBER assignments
Orestis Floros [Sun, 25 Mar 2018 17:35:53 +0000 (20:35 +0300)]
Free A_TO_WORKSPACE_NUMBER assignments

6 years agocfg_workspace: memleak on duplicate workspace assignment
Orestis Floros [Sun, 25 Mar 2018 17:23:46 +0000 (20:23 +0300)]
cfg_workspace: memleak on duplicate workspace assignment

assignment->output is set but lost since TAILQ_INSERT_TAIL is never
called when duplicate is set.
This essentially happens on every reload.

6 years agostartup.c: free timer
Orestis Floros [Sun, 25 Mar 2018 17:04:31 +0000 (20:04 +0300)]
startup.c: free timer

Small memleak. The timer is not called used again since ev_timer_init is
called with repeat = 0.

6 years agoMerge pull request #3202 from orestisf1993/issue-3201
Ingo Bürk [Sun, 25 Mar 2018 12:31:39 +0000 (14:31 +0200)]
Merge pull request #3202 from orestisf1993/issue-3201

Prefer fullscreen floating containers when on directional focus

6 years agoPrefer fullscreen floating containers when on directional focus 3202/head
Orestis Floros [Sun, 25 Mar 2018 11:25:20 +0000 (14:25 +0300)]
Prefer fullscreen floating containers when on directional focus

Fixes #3201

6 years agoMerge pull request #3196 from orestisf1993/_con_move_to_con
Ingo Bürk [Sat, 24 Mar 2018 17:49:26 +0000 (18:49 +0100)]
Merge pull request #3196 from orestisf1993/_con_move_to_con

_con_move_to_con cleanup

6 years agoMerge pull request #3199 from orestisf1993/workspace_show
Ingo Bürk [Sat, 24 Mar 2018 17:39:37 +0000 (18:39 +0100)]
Merge pull request #3199 from orestisf1993/workspace_show

workspace_show: remove redundant if

6 years agocon_activate -> con_focus when it is used as a building block 3196/head
Orestis Floros [Fri, 23 Mar 2018 11:27:05 +0000 (13:27 +0200)]
con_activate -> con_focus when it is used as a building block

6 years ago_con_move_to_con: remove outdated comment
Orestis Floros [Fri, 23 Mar 2018 11:00:36 +0000 (13:00 +0200)]
_con_move_to_con: remove outdated comment

6 years ago_con_move_to_con: showing target_ws is useless
Orestis Floros [Fri, 23 Mar 2018 10:56:30 +0000 (12:56 +0200)]
_con_move_to_con: showing target_ws is useless

The current_ws is shown latter anyway:
    if (!ignore_focus) {
        workspace_show(current_ws);
        ...

This also causes the following bug:
- Open a window in an empty workspace
- Switch to another workspace
- seturgent to the first window
- Move another window to the first workspace
- Urgent flag is now reset