Commit Graph

6854 Commits

Author SHA1 Message Date
Orestis Floros 8c17e4e38d
manage_window: cleaner variable declarations 2018-10-13 21:10:10 +03:00
Orestis Floros 966915cfb2
borders_to_hide doesn't need to be initialized 2018-10-13 21:10:10 +03:00
Orestis Floros 4219eb213b
root is externally declared 2018-10-13 21:10:10 +03:00
Orestis Floros 052e96d323
Use lround instead of (long)round 2018-10-13 21:10:10 +03:00
Orestis Floros e4d2b38552
Make comment style more consistent 2018-10-13 21:10:10 +03:00
Orestis Floros a65914f338
Fix missing prototypes
i3 will now compile with no warnings when -Wmissing-prototypes is used.
2018-10-13 21:10:10 +03:00
Orestis Floros 2a9522dda4
Enforce strict prototypes
i3 will now compile with no warnings when -Wstrict-prototypes is used.
2018-10-13 21:10:09 +03:00
Orestis Floros a15fff2370
Use path_exists 2018-10-13 21:10:09 +03:00
Orestis Floros 50880db2c5
Reduce some code around frees 2018-10-13 21:10:09 +03:00
Orestis 565d38c5af
Merge pull request #3454 from alanbarr/cppcheck_fixes_2
Cppcheck Fixes
2018-10-13 21:07:17 +03:00
Alan Barr 7c0994dafc Fixes for undefined behaviour on signed shift (#3453)
Fixes for undefined behaviour on signed shift

Change literal 1 to unsigned to allow safe bitshift of 31.
Caught by cppcheck.

Make 0xFF unsigned to prevent a left shift into signed bit.
Spotted by @orestisf1993
2018-10-13 21:04:40 +03:00
Alan Barr 687238b79b Typecast void* before doing pointer arithmetic
Caught by cppcheck
2018-10-13 17:41:50 +01:00
Alan Barr 88c378154a Remove redundant NULL check
copy has been used before this point - so it is too late to be concerned
about a NULL pointer now.

This is OK as sstrdup() calls err() on NULL return from the underlying
strdup() call.

Raised by cppcheck.
2018-10-13 17:41:50 +01:00
Aestek 6d82753d53
Add title_align config directive
Controls the window titles alignment in title bars. Possible values are:
- left
- center
- right

Co-authored-by: Orestis Floros <orestisf1993@gmail.com>
- Made title_align a config directive instead of a command. Helps with
some tree_render() issues we had.
- Made title_max_width the same for all 3 cases.
- Modified title offset calculations and added explanations for each
case.
- Append title_padding to mark_width if a mark exists.

Fixes #1750
2018-10-12 19:58:48 +03:00
Orestis Floros b09090fa7d
Fix sticky focus when switching to workspace on different output
See the testcase for the exact steps to reproduce the problem.
2018-10-11 12:27:57 +03:00
Orestis Floros 6728696ec8
output_push_sticky_windows: Make a bit easier to understand 2018-10-11 12:27:56 +03:00
Orestis Floros ba8c64c4d9
285-sticky.t: Use kill_all_windows 2018-10-11 12:04:38 +03:00
Orestis Floros e2d095cb7a
Fix flakyness in t/189-floating-constraints.t
Related to #3009.
2018-10-10 19:15:45 +03:00
Orestis Floros 8e1687a317
Rewrite con_swap to work only with queue operations
Benefits are that we don't open a fake container and don't call many
complicated functions that can lead to redraws (x_push_changes calls) as
discussed in #2954.

Fixes #2810:
Windows exchange floating mode & window rects.
Swap will still not work with CT_FLOATING_CONs but this doesn't make
much sense.

Fixes #3280:
The behaviour is not very user friendly but swap behaves exactly as it
should. The rest is a tree_flatten issue. Attached pictures in #2954.
2018-10-10 17:09:26 +03:00
Orestis Floros 11dd2dbc66
tree_move: Don't change focus order when swapping containers
The call to ewmh_update_wm_desktop is removed since the change happens
under the same parent.
2018-10-09 22:39:38 +03:00
Orestis Floros 9380a75186
move.c: Fix move_to_output_directed problems
- Use workspace_show that correctly updates _NET_CURRENT_DESKTOP, warps
mouse.
- Use TAILQ_INSERT_TAIL only for focus_head. Focus order is not related
to direction.
- Call con_focus only if con was focused before. See testcase for
directional move with command criteria.
- Correct first call of move_to_output_directed in tree_move which
didn't call ipc_send_window_event("move", con) and
ewmh_update_wm_desktop().
- Don't produce events when the move doesn't happen. Correct
276-ipc-window-move.t as well.
2018-10-09 22:35:04 +03:00
Orestis dfe89cc4f1 i3-nagbar: add option for button that runs commands without a terminal (#3258)
Fixes #2199.
2018-10-07 22:43:24 +02:00
Orestis c583f81c80
Merge pull request #3441 from stapelberg/template
add specific GitHub issue templates
2018-10-07 22:09:28 +03:00
Orestis f20467ac86
Merge pull request #3440 from stapelberg/disable
configure.ac: add conditionals for building docs/mans
2018-10-07 22:02:43 +03:00
Michael Stapelberg 824d691640 add specific GitHub issue templates
I learnt about this from the GitHub blog:
https://blog.github.com/2018-05-02-issue-template-improvements/
2018-10-07 20:41:42 +02:00
Orestis 2be4975f18 resolve_tilde: strncpy + strlen is pointless (#3436)
strlen already assumes that the string is NULL-terminated.

Like in https://github.com/i3/i3status/pull/312 but for whatever reason
gcc didn't warn about this here.
2018-10-07 20:26:37 +02:00
Orestis 18dbfe699a userguide: Mention know issues for assign (#3434)
Fixes #3222
Fixes #3293
Related to #2060
2018-10-07 20:24:09 +02:00
Michael Stapelberg acea46e16a configure.ac: add conditionals for building docs/mans
fixes #3378
2018-10-07 20:09:35 +02:00
Orestis 5720ba65ab
Merge pull request #3435 from vivien/i3-msg/subscribe
i3-msg/subscribe
2018-10-05 12:16:04 +03:00
Vivien Didelot cff4fadd72 i3-msg: add support for SUBSCRIBE message type
If i3-msg is invoked with -t subscribe, it will wait for the first event
matching the given payload, before exiting.

For instance, get the number of the next focused workspace with:

    i3-msg -t subscribe '[ "workspace" ]' | jshon -e current -e num

Like inotifywait, the -m flag allows to wait indefinitely for events,
instead of exiting right after receiving the first one.

For example, continuously monitor the names of focused windows with:

    i3-msg -t subscribe -m '[ "window" ]' | jq .container.name
2018-10-04 12:54:45 -04:00
Vivien Didelot d722d1b0e6 i3-msg: check reply in quiet mode
i3-msg currently exits right after sending the IPC message if the quiet
flag is set. This means that if an error occurred when issuing a
command, e.g. "i3-msg -q foobar", it gets silently ignored.

What we really want is to just skip printing but still check the reply.

At the same time, explicitly print the reply when we need to, instead of
using an exit label.
2018-10-03 10:43:09 -04:00
Orestis 3b73edb511
Merge pull request #3430 from Synray/aspect_ratio
[RFC] Correctly calculate max_aspect
2018-10-02 03:04:21 +03:00
Thomas Fischer 0ede8b9365 Correctly calculate max_aspect 2018-09-28 17:34:18 -07:00
Michael Stapelberg b8b5a61a2d
Merge pull request #3415 from orestisf1993/g_utf8_make_valid
Check g_utf8_make_valid availability
2018-09-28 18:00:06 +02:00
Ingo Bürk ebf40889a1
Merge pull request #3424 from orestisf1993/con_num_windows
con_num_windows: Count floating windows
2018-09-28 09:27:58 +02:00
Orestis Floros 5e1d327e43
con_num_windows: Count floating windows
Fixes #3423.
2018-09-26 20:04:17 +03:00
Ingo Bürk 27afc572c1
Merge pull request #3421 from Streetwalrus/iconic-state
Reject requests for WM_STATE_ICONIC
2018-09-26 09:07:16 +02:00
Dan Elkouby 6877205ac1 Reject requests for WM_STATE_ICONIC
For compatiblity reasons, Wine will request iconic state and cannot
ensure that the WM has agreed on it; immediately revert to normal to
avoid being stuck in a paused state.
2018-09-25 15:04:55 +03:00
Orestis Floros daf5ca111f
Provide g_utf8_make_valid if not available
See #3415 for licensing discussion.

Fixes Airblader/i3#236
2018-09-25 10:28:20 +03:00
Orestis Floros aa8215194c
Fix typo: terminaison -> termination 2018-09-24 20:53:36 +03:00
Ingo Bürk bec227236b
Merge pull request #3420 from orestisf1993/sncontext==NULL-3419
i3-nagbar & i3-config-wizard: check sncontext != NULL
2018-09-23 20:12:16 +02:00
Orestis Floros d080f58299
i3-nagbar & i3-config-wizard: check sncontext != NULL
From
07237ff25d/libsn/sn-common.c (L87-L171)
it appears that SnDisplay can't be NULL, so I skipped the check.

Fixes #3419
2018-09-23 17:06:29 +03:00
Ingo Bürk ac88d06632
Merge pull request #3416 from orestisf1993/530-bug-2229.t
530-bug-229.t: Get rid of smartmatch
2018-09-20 18:52:33 +02:00
Orestis Floros bf9da466db
530-bug-229.t: Get rid of smartmatch 2018-09-20 19:37:50 +03:00
Orestis 7c21b5995d
Merge pull request #3400 from Synray/next
Respect max size from WM_NORMAL_HINTS
2018-09-20 11:36:22 +03:00
Thomas Fischer 690e6d1f0e
Respect max size in WM_NORMAL_HINTS 2018-09-20 11:31:19 +03:00
Ingo Bürk bde4f40b67
Merge pull request #3408 from orestisf1993/__focused__-crash
match_matches_window: Check if focused->window exists
2018-09-19 14:42:28 +02:00
Ingo Bürk ea559966b5
Merge pull request #3410 from orestisf1993/min_width
docs/i3bar-protocol: Mention skipping blocks with empty full_text
2018-09-17 16:06:27 +02:00
Ingo Bürk 2b898f4c90
Merge pull request #3386 from orestisf1993/click-event
Fix "relative_x" and "width" of click events
2018-09-16 15:48:36 +02:00
Orestis Floros 9b06f1ab05
docs/i3bar-protocol: Mention skipping blocks with empty full_text
Closes #3405.
2018-09-16 15:04:20 +03:00