Commit graph

68 commits

Author SHA1 Message Date
Ryan Dwyer e4e912ea91 Store swayc coordinates as layout-local 2018-06-01 23:14:58 +10:00
Ryan Dwyer 02de2a6f65 Rename set_maximized functions to set_tiled 2018-06-01 23:14:58 +10:00
Ryan Dwyer aaba7642b3 Replace is_floating boolean with function 2018-06-01 23:14:58 +10:00
Ryan Dwyer 1f2e399ade Implement floating 2018-06-01 23:14:58 +10:00
Ryan Dwyer 1e9aaa54a8 Revert "Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements""
This reverts commit 32a572cecf.

This reimplements the criteria overhaul in preparation for fixing a
known bug.
2018-05-14 11:38:09 +10:00
emersion 360e63b8a7
Don't destroy view child on xdg-popup unmap 2018-05-12 19:33:38 +01:00
Drew DeVault 32a572cecf Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements"
This reverts commit 3e1bf721c6, reversing
changes made to 2217518bd5.
2018-05-12 08:52:54 -04:00
Ryan Dwyer 3b0c26d149 Overhaul criteria implementation
The criteria struct now uses properties for each token type rather than
the list_t list of tokens. The reason for this is that different token
types have different data types: pcre, string and number to name a few.
This solution should be more flexible moving forward. A bonus of this is
that criteria is now easier to understand when looking at the struct
definition.

The criteria parser has been rewritten because the previous one didn't
support valueless pairs (eg. [class="foo" floating]).

Criteria now has types. Types at the moment are CT_COMMAND,
CT_ASSIGN_WORKSPACE and CT_ASSIGN_OUTPUT. i3 uses types as well.
Previously the assign command was creating a criteria with 'move to
workspace <name>' as its command, but this caused the window to appear
briefly on the focused workspace before being moved to the assigned
workspace. It now creates the view directly in the assigned workspace.

Each view will only execute a given criteria once. This is achieved by
storing a list of executed criteria in the view. This is the same
strategy used by i3.

Escaping now works properly. Previously you could do things like
[class="Fire\"fox"] and the stored value would be 'Fire\"fox', but it
should be (and now is) 'Fire"fox'.

The public functions in criteria.c are now all prefixed with criteria_.

Xwayland views now listen to the set_title, set_class and
set_window_type events and criteria will be run when these happen. XDG
shell has none of these events so it continues to update the title in
handle_commit.

Each view type's get_prop function has been split into get_string_prop
and get_int_prop because some properties like the X11 window ID and
window type are numeric.

The following new criteria tokens are now supported:

* id (X11 window ID)
* instance
* tiling
* workspace
2018-05-11 09:38:53 +10:00
emersion bec80f1551
Damage borders when damaging view 2018-05-10 23:03:50 +01:00
Ryan Dwyer 228c478e8d Implement title_format
This implements the title_format command, with a new placeholder %shell
which gets substituted with the view type (xwayland, xdg_shell_v6 or
wl_shell).

Example config:

    for_window [title=".*"] title_format %title (class=%class instance=%instance shell=%shell)
2018-05-05 22:29:37 +10:00
Ryan Dwyer 74d1367fac Update titles when surfaces are committed 2018-05-03 15:42:49 +10:00
Ryan Dwyer e67f354333 Implement borders
Implements rendering of borders. Title text is still to do.

Implements the following configuration directives:

* client.focused
* client.focused_inactive
* client.unfocused
* client.urgent
* border
* default_border
2018-04-30 21:24:13 +10:00
emersion 3fd8897abe
Don't call view_set_fullscreen on unmapped xwayland views 2018-04-28 20:44:42 +01:00
emersion df245780d2
Do not let tiled xwayland views do what they want 2018-04-24 18:19:26 +01:00
emersion 17bee33fc9
Don't unmap on destroy, this is already guaranteed by wlroots 2018-04-20 16:24:34 +01:00
Ryan Dwyer 143b528f71 Handle fullscreen flag when mapping a surface. 2018-04-17 11:04:57 +10:00
Ryan Dwyer bfd5834f4c Feedback for fullscreen. 2018-04-17 08:11:50 +10:00
Ryan Dwyer 52420cc24d Implement fullscreen. 2018-04-16 20:36:40 +10:00
emersion bdaf420ead
Do not call the map handler when an xwayland surface is created 2018-04-13 14:43:41 +02:00
emersion 2b357af7ee
Give keyboard focus to unmanaged xwayland surfaces
This fixes dmenu
2018-04-07 14:03:30 -04:00
emersion 516f5454ad
Simplify damage tracking functions, use them in layer shell 2018-04-06 11:45:40 -04:00
emersion 290c916290
Send surface enter/leave events to view children 2018-04-06 10:26:32 -04:00
emersion 641807d920
Handle unmanaged surfaces motion 2018-04-05 18:48:35 -04:00
emersion 1c91d0c10f
Add damage tracking for xwayland unmanaged surfaces 2018-04-05 17:39:17 -04:00
emersion 07f3bb3ad1
Handle xwayland configure requests for unmanaged surfaces 2018-04-05 17:22:39 -04:00
emersion a528aea2ee
Make xwayland surface destroy more foolproof 2018-04-05 17:11:46 -04:00
emersion 7ce1038478
Fix xwayland unmanaged surfaces 2018-04-05 17:08:30 -04:00
emersion dcd15a2d3d
Implement shell views 2018-04-05 11:40:39 -04:00
emersion 8eff00f723 Remove unused SWAY_VIEW_TYPES 2018-04-04 22:03:14 -04:00
emersion 2f64ce86c4
Xwayland unmanaged views aren't views anymore 2018-04-02 14:35:43 -04:00
emersion 61fabede14
Address review comments 2018-04-02 10:57:45 -04:00
emersion 1d68f9ecca
Add sway_view_impl 2018-03-31 18:07:44 -04:00
emersion b2c2ee693b
Introduce common functions to create, map, unmap, destroy views 2018-03-31 17:49:40 -04:00
Drew DeVault 89ca6676be
Merge pull request #1681 from emersion/xwayland-configure-position
Fix various xwayland issues
2018-03-31 11:40:34 -04:00
emersion 98b67e2399
Fix xwayland configure in set_size 2018-03-31 11:30:15 -04:00
emersion 6579717994
Fix xwayland configure position 2018-03-31 10:53:53 -04:00
emersion 5f3fce7519
Maximize xwayland views by default 2018-03-30 23:58:40 -04:00
emersion 139f80b0f0
Handle map/unmap events in xdg-shell-v6 2018-03-30 17:43:43 -04:00
emersion a776ecbb86
Add lite damage tracking
This skips the renderer if nothing has changed, and renders
everything otherwise.
2018-03-30 17:16:35 -04:00
Tony Crisci 7e0d430a0c
Merge branch 'wlroots' into wlroots-xwayland-map 2018-03-30 16:16:12 -04:00
Drew DeVault 49379dd0fc Fix workspace deletion edge cases 2018-03-30 13:49:34 -04:00
emersion cf09ea184b
Use the new map/unmap events for xwayland views 2018-03-30 13:34:25 -04:00
Drew DeVault a5e457d59a Add xwayland views to focused container 2018-03-30 12:06:45 -04:00
emersion 681f38c878
Fix segfault on xwayland unmanaged view unmap 2018-03-30 11:22:12 -04:00
emersion 28cb412b0d
Unify initial xwayland view mapping with map handler 2018-03-30 10:09:56 -04:00
Drew DeVault 2d46050281 Fix crash when override redirect views close 2018-03-30 00:46:40 -04:00
Tony Crisci dc8c9fbeb6 Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"
This reverts commit 472e81f35d, reversing
changes made to 6b7841b11f.
2018-03-29 23:41:33 -04:00
Drew DeVault d0c7f66e95
Revert "Refactor tree" 2018-03-29 23:29:29 -04:00
Tony Crisci 2778edef97 arrange windows 2018-03-29 23:15:39 -04:00
Tony Crisci eca029f218 more renaming things 2018-03-29 17:06:29 -04:00