Commit Graph

527 Commits (35eac121fc68ea02b60abea4f38a9dd5f1389795)

Author SHA1 Message Date
Tony Crisci 0711f5ab4e Add test for floating types
Add a test that verifies that windows with properties that indicate they
should be floating are indeed opened floating.
2014-03-08 21:00:50 +01:00
Marco Hunsicker 00ee86de79 Send IPC window events for focus and title changes
This patch fixes ticket #1168 to extend the window IPC event mechanism
to send IPC events for window focus and title changes. The newly added
window events use the same format as the already established "new"
event.

Specifically this patch:

* Moves the ipc_send_window_event() function from src/manage.c into
  src/ipc.c and adds an argument for the change property of the event
* Updates src/manage.c to use the new function signature. To ensure
  that the "new" event does not send the same event data as the
  "focus" event, setting focus now happens after the "new" event
  has been sent
* Adds IPC focus event notification to src/x.c. To workaround a problem
  during window close when accessing the window name, a function has been
  added to query whether a window is actually attached to its parent. To
  avoid obsolete focus notification, a new field has been added to keep
  track of the focus without any interference by the click handling
* Adds IPC title event notification to src/handlers.c. To avoid
  obsolete title notification, a function has been added to determine
  whether a window title has actually changed
* Updates the IPC documentation to include the new events
* Updates testcases/t/205-ipc-windows.t to include the "focus" event
  in order to ensure the correct event sequence
* Adds two new unit tests, b/testcases/t/219-ipc-window-focus.t and
  b/testcases/t/220-ipc-window-title.t to ensure proper "focus" and
 "title" events
2014-02-26 22:24:19 +01:00
Michael Stapelberg 07d583d780 tests: sync_with_i3 before warping pointer
To be honest, I’m not entirely sure where the race condition originates
from, but when making sure that there are no pending events
(which is what sync_with_i3 accomplishes) before warping the pointer, we
have less flaky testsuite runs.

closes #1189
2014-02-25 20:44:17 +01:00
Michael Stapelberg 62a4237ed0 t/130-close-empty-split: clean up old workspace
This hopefully increases the reliability of the test. Empty containers
created by “open” sometimes get spurious UnmapNotify events, and in at
least one run, this test failed because of such an event.
2014-02-13 21:05:42 +01:00
Tony Crisci 6ae4ecb1de Bugfix: `tree_split` should not split floating cons
Use the more robust test of `con_is_floating` for testing a container
for being floating.

fixes #1177
2014-02-08 20:59:23 +01: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 10d7c1a993 Merge branch 'master' into next 2014-01-13 23:36:47 +01:00
Tony Crisci 7639337716 Bugfix: `move <direction>` sends workspace focus
Make sure the command `move <direction>` properly sends the workspace
focus ipc event required for i3bar to be properly updated and redrawn.

Make `ipc_send_workspace_focus_event publicly available from ipc.h for
more flexible event sending.
2014-01-13 23:36:31 +01:00
Tony Crisci aa11c03d4c Movement into a branch considers movement direction
Change the behavior of movement into a branch with respect to the
position the moving con will be placed within the branch when the
movement is complete.

The correct position is determined by the direction of movement or the
position of the focused-inactive container within the branch.

If the direction of movement is the same as the orientation of the
branch container, append or prepend the container to the branch in the
obvious way.  If the movement is to the right or downward, insert the
moving container in the first position (i.e., the leftmost or top
position resp.) If the movement is to the left or upward, insert the
moving container in the last position (i.e., the rightmost or bottom
position resp.)

If the direction of movement is different from the orientation of the
branch container, insert the container into the branch after the
focused-inactive container.

fixes #1060
2014-01-06 22:26:23 +01:00
Michael Stapelberg 81fd4ec71c add testcase for #1149 2014-01-05 20:37:42 +01:00
Michael Stapelberg 9daf0d8b2b t/215-layout-restore-crash: fix test description 2014-01-04 21:57:35 +01:00
Michael Stapelberg 90e7c5c18a tests: add t/215-layout-restore-crash.t for the last couple of commits 2014-01-04 21:39:33 +01:00
Michael Stapelberg 318b089e6d fix test after renaming role to window_role 2013-12-22 21:52:49 +01:00
Michael Stapelberg ef7b3e5464 allow parsing multiple nodes from a json layout 2013-12-22 21:52:49 +01:00
Michael Stapelberg 6800524f2e GET_TREE: serialize container type into a string
So far, this was blessed for internal use only (by virtue of not being
in the documentation), but we want to expose it for the stored layouts.
2013-12-22 21:52:49 +01:00
Michael Stapelberg 58297f4ab5 layout restore: support more criteria, match only once (+test) 2013-12-22 21:52:49 +01:00
Michael Stapelberg 4add185025 tests: add simple layout restore test 2013-12-22 21:52:49 +01:00
Michael Stapelberg b2c91f54ab Merge branch 'master' into next 2013-12-21 21:32:55 +01:00
Michael Stapelberg 85321bdf1d Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim)
fixes: #1136
2013-12-21 21:32:23 +01:00
Tony Crisci 18ad1fd4de Refactor and improve test 514
Split test 514's assertion into three assertions to make it more
explicit what is being tested, and why a run might fail.

Move critical test code out of the event handler to clarify flow and
allow a query of the actual current workspace to use in assertions.

Works around an issue which caused this test to fail spurriously because
of pointer-related quirks in the i3 test suite which would sometimes
cause i3 to open on workspace 2 (However, the test is now agnostic to
the initial workspace or output).
2013-12-04 19:50:35 +01:00
Michael Stapelberg ca39289e3e t/516-move: use window id, fix typo 2013-11-19 20:28:32 +01:00
Tony Crisci 9f955a1e01 Command 'move <direction>' moves across outputs
When 'move <direction>' is issued in the context of a container that
borders a workspace, and there is no suitable place within this
workspace for which this container can move, move the container to the
closest output in this direction instead.
2013-11-19 20:26:52 +01:00
jj b6100dd727 Fix output retrieval for floating cons
When focusing/moving to outputs, the method of getting the correct
output for a given container fails if the container in question is
floating and only partially mapped on an output screen. This patch
introduces a fail-safe retrieval of the output for any container.
2013-10-23 23:26:06 +02:00
Tony Crisci e99158e419 Assigned windows open urgent when not visible
When i3 begins to manage a window, if the window opens on a workspace
that is not visible, the urgency hint on the newly managed window will
be set.

fixes #1088
2013-10-19 10:07:24 +02:00
jj bf1699e967 Fix command parser: resizing tiling windows
i3 would accept an invalid resize command like 'resize shrink width 10
px or' without specifying the ppt value, and then crash. This patch
fixes the parser specification.
2013-10-13 18:02:40 +02:00
Michael Stapelberg 1c0554564a previous commit: extend test and code to also work with floating windows 2013-10-13 17:59:29 +02:00
jj 98c4cc46e4 Do not resize/reposition floating containers when moving them to scratchpad 2013-09-30 22:54:35 +02:00
Michael Stapelberg 8d38529bcd tests: move set_wm_class to X11::XCB::Window
This code was duplicated way too often for a long time :)
2013-09-24 21:56:52 +02:00
Michael Stapelberg 031de8f720 Merge branch 'master' into next 2013-09-24 07:48:09 +02:00
Michael Stapelberg 1a1d421534 Bugfix: correctly recognize assigned windows as urgent (Thanks jookia)
fixes #1086
2013-09-24 07:47:36 +02:00
syl20bnr 7098ef602b Add new bar.binding_mode_indicator configuration.
i3 current behavior hides the binding mode indicator when
workspace buttons are disabled.
This patch adds a new configuration for i3bar called
'binding_mode_indicator' which acts like the workspace_buttons.
It is now possible to configure i3bar to hide the
workspace buttons and keep showing the binding mode indicator.
This should make the hide workspace buttons configuration
more convenient for those who are heavily using binding
modes.
Default value for binding_mode_indicator is true.
2013-09-24 06:59:26 +02:00
jj 97b086efd9 Close all children when closing a workspace
fixes #591
2013-09-24 06:45:52 +02:00
jj ee04f8bfda Fix handling of new windows with WM_STATE_FULLSCREEN
If the currently focused window is in fullscreen mode, and a new window
is opened with WM_STATE_FULLSCREEN set, the new window now becomes the
new fullscreen window and gains focus.
2013-09-24 06:36:56 +02:00
Michael Stapelberg 3ba8642efd tests: fix setting the urgency hint
X11::XCB < 0.08 had a bug which caused this code to work even though it
shouldn’t.
2013-09-24 06:36:08 +02:00
Michael Stapelberg a52b5212ea Merge branch 'master' into next 2013-09-01 13:35:19 +02:00
Michael Stapelberg 2481b9dcd7 Bugfix: don’t flatten tabbed/stacked containers
fixes #1053
2013-09-01 13:35:04 +02:00
Sebastian Ullrich 431e98dc35 Respect workspace numbers when looking for a free workspace name
This prevents a ws '1' appearing on a new output when there's
already a ws '1: www' on an existing output
2013-08-18 17:47:53 +02:00
koebi 88671986f4 implement unmark command 2013-07-17 23:02:31 +02:00
Michael Stapelberg eec80838ab actively delete _NET_WORKAREA on startup
fixes #1038
2013-07-13 12:24:15 +02:00
Franck Michea 1f8a860744 bugfix: Resize and center a scratchpad even when a criteria is used. 2013-07-11 21:18:21 +02:00
Alexander Berntsen 023594909e Implement debuglog command
Add debuglog command that takes toggle|on|off. Add get_debug_logging()
to be able to toggle. Make t/187-commands-parser.t expect 'debuglog'.
Document the debuglog command in userguide.
2013-07-07 15:33:42 +02:00
Michael Stapelberg c4d4418745 Merge branch 'master' into next 2013-06-29 20:58:51 +02:00
Michael Stapelberg d055e70a89 tests: update t/172-start-on-named-ws.t to check the previous commit 2013-06-29 20:58:33 +02:00
Michael Stapelberg 78e99440f6 Merge branch 'master' into next 2013-06-29 20:28:07 +02:00
Michael Stapelberg b4f7142509 Bugfix: fix focus handling in 'floating disable' on non-visible windows (Thanks necoro)
fixes #1027
2013-06-29 20:27:33 +02:00
oblique 78fad71894 Update parent urgency hint if a child is removed. 2013-06-23 22:27:30 +02:00
Michael Stapelberg 3cf46ef4cc add a testcase for the shmlog command 2013-06-23 22:14:59 +02:00
Alexander Berntsen f9d93d75b3 Implement shmlog command
Add shmlog command that takes <size>|toggle|on|off. Separate logbuffer
management into open_logbuffer() and close_logbuffer(). Make
t/187-commands-parser.t expect 'shmlog'. Add update_shmlog_atom() to
update the SHMLOG_PATH. Document the shmlog command in userguide.
2013-06-23 21:48:02 +02:00
haptix@web.de e3913093b6 introduced i3 command for changing the hidden state and the mode of i3bar
The hidden_state and mode of each i3bar instance can now be controlled from within i3.
Therefore, two new i3 command were introduced:
    _
    bar hidden_state show|hide|toggle [<bar_id>]

    show: always show the bar
    hide: normal hide mode
    toggle: toggle between show and hide (individually for each bar)
    _
    bar mode dock|hide|invisible|toggle [<bar_id>]

    hide,dock: like before
    invisible: always keep the bar hidden
    toggle: toggle between dock and hide (individually for each bar)

This patch introduces a hidden_state ("hidden_state hide|show") in the
barconfig, which indicates the current hidden_state of each i3bar
instance. It only affects the bar when in hide mode. Additionally, a new
invisible mode was introduced. In order to change the hidden_state or
mode of the bar from i3, a barconfig-update event was introduced, for
which a bar can subscribe and the bar then gets notified about the
currently set hidden_state and mode in its barconfig.

For convenience, an id field ("id <bar_id>") was added to the barconfig, where one can
set the desired id for the corresponding bar. If the id is not specified, i3 will
deterministically choose an id; otherwise, with the previous random approach for finding
a new id, which is actually not shared with i3bar, as it would determine its id on
startup, the event-subscription would be destroyed on reload. Still, this issue remains
when manually changing the bar_id in the config and then reloading.

fixes #833, #651
2013-05-25 23:00:36 +02:00
haptix@web.de f0eba6d15c Fix problem when moving fullscreen window to scratchpad
When moving a fullscreen window to scratchpad with 'move scratchpad', the
focused window would stay fullscreen.

Also, when having a container in fullscreen mode and then focusing a child of
this container and moving it to scratchpad, it would enable fullscreen for
the child window.

This patch fixes both problems, so the scratchpad window is always floating.
2013-05-25 22:59:27 +02:00