In other parts of the code, use_geometry implies a parent is present. So
let's clear it when we clear relative placement.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Having use_geometry set is not the only time we have a parent window,
apparently.
Clicking on the 'Line diff' drop down in gitk would cause an assert()
because of this.
Fixes#769
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Preserve the same order as desktop-shell for handling view (un)mapping,
so we can move these into a shared helper. These should have no
functional effect but provide a helpful bisect point.
Signed-off-by: Daniel Stone <daniels@collabora.com>
A popup grab is specified to have the top most popup surface gain
keyboard focus. This means the keyboard focus should always follow the
most recent xdg_popup.grab() surface. Make sure this happens by keeping
track of the parent surface in the libweston-desktop popup grab,
updating the keyboard focus when surfaces are added and removed from the
popup chain, and restoring the keyboard focus to the toplevel when there
are no popups anymore.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Popups should have keyboard focus when active, but the toplevel window
should still appear "active". Make sure this is the case by changing the
"active" tracking to see whether any child surface has keyboard focus.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
I also snuck in a trivial change to drag_surface_configure at the same
time to avoid yet another micro patch.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
One variant is used when a view is being positioned relative to a parent,
the other is when the view is being given an absolute position in the
global space.
This will help later when surface and global coordinates are different
data types, but for now the two functions do essentially the same thing.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This introduces a few getters to retrieve the pending state from
libweston-desktop, now just libweston, and makes use of it,
specifically get_pending_maximized to avoid sending invalid
dimensions to the client in the particular use case
set_maximized/unset_fullscreen.
These pending state getters are useful to query/poke a not-applied
yet state, and could be useful where we don't have a buffer attached
where the client might be set-up as maximized, but internally libweston
hasn't yet applied that pending state.
Fixes#645
Suggested-by: Morgane Glidic <sardemff7+git@sardemff7.net>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With commit 'Move libweston-desktop into libweston' we've moved out
libweston-desktop DSO into libweston. Move also the header to
libweston/desktop.
This removes removes the libweston-desktop pc file and bumps libweston
major version to 12.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With the help of a newly introduced function, weston_desktop_surface_set_orientation(),
this patch adds missing tiled states from the xdg-shell protocol.
The orientation state is passed on as a bitmask enumeration flag, which the
shell can set, allowing multiple tiling states at once.
These new states are incorporated the same way as the others, retaining
the set state, but also avoiding sending new configure events if nothing
changed since previously acked data.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
It's not really useful to have libweston without libweston-desktop. It's
also very little code.
Merging both into the same DSO will allow us to cut out a bunch of
indirection and pain.
Signed-off-by: Daniel Stone <daniels@collabora.com>