Commit graph

63 commits

Author SHA1 Message Date
Zandr Martin 4c0e809028
prevent dereference of freed workspace 2016-10-02 22:03:52 -05:00
Zandr Martin 58ac1f7f24 fix pointer format string in sway_log() call 2016-10-01 06:40:16 -05:00
Zandr Martin e18b7cdfa9
add global current_focus pointer 2016-09-17 15:54:45 -05:00
Drew DeVault 38ca94e0ed Tweak how swaylock surfaces are handled
Fixes #875
2016-09-01 08:34:52 -04:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Hummer12007 db1c105e77 Fix a format string 2016-08-22 18:56:49 +03:00
Tony Crisci 81eb9ea12c Simplify focus setting
Merge the main rendering paths of all containers to make focus setting a bit
simpler and easier to follow.
2016-08-03 23:24:53 -04:00
Tony Crisci 2f65100bee Remove dead global locked_view_focus
The value of `locked_view_focus` is always false. Remove dead code associated
with this variable to simplify things.
2016-08-01 22:25:08 -04:00
Tony Crisci fe608c80ae Update view border when workspace is focused
When a workspace is focused, update the borders of all its child containers to
be focused to indicate the workspace container is focused.
2016-07-31 21:42:51 -04:00
Tony Crisci f78d07d39b Implement focus handling for containers
The previous implementation of focus handling assumed that only views can be
focused. Containers can also be focused with a command like `focus parent` or
`focus child`.

Change `set_focused_container()` to handle the case of the given container
being a container with children and update borders accordingly.
2016-07-31 18:10:33 -04:00
Tony Crisci 88b7cbe314 Implement focus child command
The `focus child` command focuses the child container within the selected
container.
2016-07-27 22:48:46 -04:00
Tony Crisci 8a03f138bf bugfix: set focus to workspace of an output
In `move_focus()`, when given an output, set the focus to the workspace of that
output instead of the output itself.

This fixes a bug that did not allow users to switch between outputs introduced
in afc6ad6.

It also fixes other issues before that commit when a workspace with children
was selected and the user tried to switch focus in the direction of another
output.
2016-07-27 22:06:16 -04:00
Tony Crisci afc6ad6419 bugfix: cmd focus parent don't set focus above ws
In the `focus parent` command, do not set focus above the workspace level.
These containers are not meant to be focused.

This prevents a crash on repeated `focus parent` commands.
2016-07-27 21:30:45 -04:00
Mykyta Holubakha a2bc6f3bfd Arrange backgrounds only when required 2016-07-21 22:47:35 +03:00
Mykyta Holubakha 976e48d79f Initial work on window events 2016-07-21 21:51:20 +03:00
D.B ad7605675e refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed 2016-07-16 15:34:43 +02:00
Mykyta Holubakha c503bf1342 Suspend destruction of wss when creating views 2016-07-15 00:22:53 +03:00
Zandr Martin d5e4fff345
resize command updates (#713) 2016-07-03 12:11:21 -05:00
Zandr Martin d291a29f30 enforce workspace output assignents
when creating a new output, move to that output all extant workspaces
that are assigned to that output.

(unrelated) remove comment that was no longer applicable, fix spacing in
an assignment
2016-05-28 18:18:46 -05:00
Zandr Martin 164f384d83 set focus on fullscreen view when changing focus 2016-05-23 16:05:44 -05:00
Mikkel Oscar Lyderik 3e1f78ab26 Add support for nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 8d700fe008 Fix problems with floating windows
Makes any tabbed/stacked layout a container to separate from floating
windows which may be attached to a workspace.
2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik ec7ff769c7 Tabbed and stacked layout 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik f39034a55f Use correct format string for x86_64 and i686
Fix #587
2016-04-17 16:51:33 +02:00
Eric Engestrom 3e8081514d Fix spelling mistakes 2016-04-02 16:00:05 +01:00
Mikkel Oscar Lyderik 7878de5ccc Mark focused view focus_inactive on unfocused output 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 5a13cb0ed1 Implement borders
The borders are implemented as a surface/buffer attached to each view
which is sent to and rendered by wlc in the view_pre_render callback.

All the drawing logic is handled in sway/border.c and all the logic for
calculating the geometry of the border/view is handled in
`update_geometry` in sway/layout.c (same place as gaps are calculated).
2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik eb82a500c8 Remove focus when switching to empty workspace
Fix #504
2016-03-05 15:39:28 +01:00
Mikkel Oscar Lyderik 2c43bd2ac8 Only update visibility if WS isn't destroyed after
No need to update visibility if the workspace will be destroyed right
after.
2016-01-21 22:05:06 +01:00
Mikkel Oscar Lyderik 50b04884b6 Trigger ipc_event_workspace in all cases
This makes sure that the workspace IPC event is triggered when needed.

Fixes #382 while making sure that the IPC event is only triggered once.
2015-12-21 23:07:52 +01:00
S. Christoffer Eliesen 18a7afa1b3 focus: Fix moving last workspace.
If there's only one workspace on an output and it's moved to a different
output then active workspace will be NULL.
2015-12-18 13:23:49 +01:00
Kevin Hamacher 64a183b23d Fix dangling pointer on focus swap/describe WS 2015-12-14 11:43:17 +01:00
Drew DeVault 7868e44d3f Notify IPC on workspace changes more frequently 2015-12-13 16:59:22 -05:00
Kevin Hamacher d77d03ce84 Make destroy_workspace behave as expected 2015-12-13 18:19:24 +01:00
Drew DeVault 9b9d968cbf Fix for_window [...] move scratchpad correctly 2015-12-01 18:09:37 -05:00
Drew DeVault d098c620fe Revert "Fix bug with for_window [...] move scratchpad"
This reverts commit 0796b0c475.
2015-12-01 18:05:37 -05:00
Drew DeVault 0796b0c475 Fix bug with for_window [...] move scratchpad 2015-12-01 18:00:46 -05:00
Drew DeVault 27f03c705d Move IPC client into common, refactor IPC 2015-11-27 09:50:04 -05:00
Mikkel Oscar Lyderik d5b5d92b30 Include header declaring ipc_event_workpace(2) 2015-11-04 21:12:25 +01:00
taiyu 65d71d0a5e put ipc_event_workspace in update_focus 2015-11-02 11:28:51 -08:00
S. Christoffer Eliesen 78ca619769 commands: Learn mouse_warping.
Place mouse at center of focused view when changing to a workspace on a
different output, if option is enabled. (This replicates existing i3
option.)

This can be triggered in multiple ways:
A) via `workspace <name>` which changes output
B) via `focus <direction>` which changes output
C) via `focus output <name>` which (obviously) changes output
2015-10-29 17:41:33 +01:00
S. Christoffer Eliesen 5a70853253 log: Add swayc_log, use at a few key places.
swayc_log works just like sway_log, but appends type and name from given
container to the log output.
2015-10-25 13:14:28 +01:00
S. Christoffer Eliesen c1479701de seamless_mouse: Move pointer only if successfully changed workspace.
If e.g. a window has a popup open then that will lock the current focus,
making a workspace switch denied.

So don't move the mouse pointer in such cases.
2015-10-23 16:35:48 +02:00
taiyu 5678d824e4 update visibility + container info functions 2015-08-27 23:18:28 -07:00
taiyu 225c2fbe5b fixed segfault on exit + a little fixup of that floatfocus pr 2015-08-25 13:29:33 -07:00
minus ca89ba83a8 changed view visibility to be bool
view_visibility enum remains with one constant that is the mask to wlc's view masking
2015-08-25 20:13:35 +02:00
minus f22c937953 refactored view visibility
- replace visibilty mask integers with an enum
- set output's visibilty mask on creation
- added update_visibility to manually update a containers visibility (e.g. when it moved to an invisible workspace)
2015-08-25 18:24:15 +02:00
taiyu 36cd180f02 fixed vanishing floating view 2015-08-22 18:25:05 -07:00
taiyu 1a1ac64662 bugfixes, renames 2015-08-21 10:28:37 -07:00
taiyu f5fde7c45c style 2015-08-20 05:06:22 -07:00