Commit graph

91 commits

Author SHA1 Message Date
Ryan Dwyer
96c8c02483 Fix flash of background when xwayland views are mapped
A flash of background was happening for two reasons:

1) We were using the xsurface's dimensions to check if the surface is
ready, but these are pending dimensions.
2) In my particular setup, the default geometry of the xsurface does not
intersect any output, which prevented it from receiving a frame done
event. This made the transaction time out and the client would only
redraw once it's been rendered.
2018-06-30 14:30:14 +10:00
Ryan Dwyer
a2fbb20a61 Merge remote-tracking branch 'upstream/master' into atomic 2018-06-29 20:04:24 +10:00
Armin Preiml
c4b900c1e0 fix accidently removing borders on XCB_CONFIGURE_REQUEST
The view was configured with the container coordinates.
Although they were right on the first configure, they
changed after a XCB_CONFIGURE_REQUEST, when the
border was already drawn.
2018-06-27 17:56:53 +02:00
Ryan Dwyer
e6829c5991 Move unsetting of view->surface into view_unmap 2018-06-27 17:54:57 +10:00
Ryan Dwyer
be86d3aba6 Remove transaction_add_damage
Instead, damage each container when applying the transaction.
2018-06-27 17:46:03 +10:00
Ryan Dwyer
e8001e6fbe Damage output when views toggle fullscreen
Also add workspace to the transaction when a view maps in fullscreen
mode.
2018-06-26 14:24:15 +10:00
Ryan Dwyer
50190bc760 Rename view's free callback to destroy 2018-06-26 13:18:33 +10:00
Ryan Dwyer
7a922c65aa Damage output when a fullscreen view unmaps
Also moved the arranging into view_unmap to avoid excessive code
duplication.
2018-06-26 13:15:45 +10:00
emersion
eeb38d65cb
xwayland: accept configure requests from floating views 2018-06-24 19:21:02 +01:00
Ryan Dwyer
1549fb719a Implement atomic layout updates for xwayland views 2018-06-24 23:01:09 +10:00
Ryan Dwyer
38398e2d77 Implement atomic layout updates for tree operations
This implements atomic layout updates for when views map, reparent or
unmap.
2018-06-23 16:24:11 +10:00
emersion
cda66e9a26
Automatically float xwayland windows 2018-06-18 22:52:10 +01:00
Ryan Dwyer
1c89f32533 Preserve buffers during transactions
* Also fix parts of the rendering where it was rendering the pending
state instead of current.
2018-06-18 20:42:12 +10:00
Ryan Dwyer
bb66e6d578 Refactor everything that needs to arrange windows
* The arrange_foo functions are now replaced with arrange_and_commit, or
with manually created transactions and arrange_windows x2.
* The arrange functions are now only called from the highest level
functions rather than from both high level and low level functions.
* Due to the previous point, view_set_fullscreen_raw and
view_set_fullscreen are both merged into one function again.
* Floating and fullscreen are now working with transactions.
2018-06-09 10:11:25 +10:00
Ryan Dwyer
f9e6d703d2 Make main properties be the pending state 2018-06-09 10:08:43 +10:00
Ryan Dwyer
59c9488701 WIP: Atomic layout updates ground work 2018-06-09 10:08:43 +10:00
Ryan Dwyer
1206a60977 Don't restore focus if unmapping surface wasn't focused 2018-06-04 13:31:09 +10:00
Ryan Dwyer
74799937cf Restore focus when unmapping unmanaged xwayland surfaces 2018-06-04 11:30:26 +10:00
Ryan Dwyer
c9e3a313b4 Fix fullscreen position of xwayland views 2018-06-01 23:14:58 +10:00
Ryan Dwyer
9119f87655 Fix floating position when view is floated when mapped 2018-06-01 23:14:58 +10:00
Ryan Dwyer
97672295ed Don't unmaximize floating views 2018-06-01 23:14:58 +10:00
Ryan Dwyer
becceafa7f Remove unfinished wants_floating implementation for xwayland 2018-06-01 23:14:58 +10:00
Ryan Dwyer
5b1601c2e3 Don't let xwayland views set position unless unmanaged 2018-06-01 23:14:58 +10:00
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