Commit Graph

433 Commits

Author SHA1 Message Date
Kristian Høgsberg 0ed6750541 shell: Only assign focus on touch if there is a touch focus surface
Similar to 7c4f6cc145, if we don't have
a background image from the desktop-shell client or the touch point
for some other reason doesn't hit a surface we trigger a
segfault as we try to deref the seat->touch->focus NULL pointer.

For touch, another problem could be fudgey calibration that ends up
giving touch coordinates outside the output space.

https://bugs.freedesktop.org/show_bug.cgi?id=72839
2014-01-02 23:00:11 -08:00
Kristian Høgsberg 9f7e331a20 xwm: Handle WM_TRANSIENT_FOR
Set up X windows that are transient for another window as transient
surfaces in shell.c.  This keeps the transient windows on top of their
parent as windows are raised, lowered for fullscreened.

https://bugs.freedesktop.org/show_bug.cgi?id=69443
2014-01-02 22:55:04 -08:00
Kristian Høgsberg 0e45e8712a shell: Start the input panel slide slightly on the output
If a surface is not on any output, scheduling a repaint for it is a no-op.
weston_view_schedule_repaint() schedules repaints for all outputs that
overlap with the surface extents, but if the surface is completely
outside all outputs nothing will be scheduled.  Fix this for now by starting
the slide slightly into the output.
2014-01-02 01:33:42 -08:00
Kristian Høgsberg 2eebcd34fc shell: Test for surface->width == 0 to see if input-panel was unmapped
The input-panel codes tries to see determine if a buffer has not yet
been attached (or a NULL buffer has been attached), and doesn't map
the input panel surface yet in that case.  However, it test for
buffer_ref being NULL, which can happen for other reasons.  The right
test is to see if surface->width is 0, which means that either a
buffer hasn't yet been attached or a NULL buffer has been attached.

https://bugs.freedesktop.org/show_bug.cgi?id=72519
2014-01-02 01:27:38 -08:00
Kristian Høgsberg c30c8a3db5 shell: Always set input-panel position on initial configure
If we're not currently showing the input panels, we still need to set the
panel position so that it's set when we later need to show them.  This fixes
the initial flicker of the input panel in the wrong position when we first
show it.
2014-01-02 00:45:19 -08:00
Kristian Høgsberg 8bc525c60d shell.c: Set state_changed for xwayland surfaces as well
Fixes the problem where xwayland surfaces pop up at 0,0 always.
2014-01-01 22:34:49 -08:00
Kristian Høgsberg 7c4f6cc145 shell: Only assign focus on click if there is a pointer focus surface
If we don't have a background image from the desktop-shell client or the
pointer for some other reason doesn't have a focus we trigger a
segfault as we try to deref the seat->pointer->focus NULL pointer.

https://bugs.freedesktop.org/show_bug.cgi?id=73066
2014-01-01 16:28:32 -08:00
Kristian Høgsberg 8662349394 shell.c: Back out alt-tab functionality
This is still fairly unstable, causes lockups with fullscreen and exposay,
leaves small preview surfaces on-screen if used on the same modifier as
mod-tab.  We also only need on mod-tab implementation so lets see if we
can consolidate the current and this alt-tab implementation in 1.5.

https://bugs.freedesktop.org/show_bug.cgi?id=72610
2014-01-01 16:10:44 -08:00
Jason Ekstrand 6228ee235f Fix the size of surfaces created in create_black_surface
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-01-01 14:01:14 -08:00
Kristian Høgsberg ead5242e07 shell: Fix up previous broken commit 2014-01-01 13:51:52 -08:00
Kristian Høgsberg d55db69c94 Revert "shell: Change stacking order calculation for popup surfaces"
Popup windows are relative to a plain wl_surface, so that custom surfaces
can have popups.  This used for the desktop-shell panel for example.  Also,
popups should be immediately on top of their parent surface, as they
typically represent an extension of an UI element in the parent surface
such as a combo box or menu.

This reverts commit da704d97fa.

Conflicts:
	desktop-shell/shell.c

https://bugs.freedesktop.org/show_bug.cgi?id=72547
2014-01-01 12:26:14 -08:00
Kristian Høgsberg a1df7acb78 shell: Set state_changed when we make a surface transient
If we don't mark the state as changed, we don't copy over next_state to
state and we fail to treat the surface as a transient.  In particular,
we give it a random intial position instead of mapping it at the given
parent relative position.

https://bugs.freedesktop.org/show_bug.cgi?id=72532
2013-12-31 15:01:09 -08:00
Ander Conselvan de Oliveira 312ea4ca42 shell: Handle the desktop shell client destroy signal
Set the internal pointer for the client to NULL. This fixes a
segmentation fault at shutdown, where the shell would hang up before
and cause libwayland to call wl_client_destroy(). When the shell was
destroyed later, another call to wl_client_destroy() would cause the
crash.

https://bugs.freedesktop.org/show_bug.cgi?id=72550
2013-12-22 13:45:36 -08:00
Jason Ekstrand 5c11a3340b Add a weston_surface_set_size function
Surfaces that are created by clients get their size automatically updated
by the attach/commit.  Surfaces created directly by shells (such as black
surfaces) sometimes need to be manually resized.  This function allows you
to do that while being somewhat less messy than messing with the internals
of weston_surface manually.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-12-16 17:23:09 -08:00
Ander Conselvan de Oliveira fc63fddcee shell: Reset fullscreen and maximized state on output unplug
When a view is moved to another output because its current output was
unplugged, remove the fullscreen and maximized state.
2013-12-16 17:23:08 -08:00
Zhang, Xiong Y 31236932a1 desktop-shell: Invalidate saved position when output is destroyed
If the saved position for a fullscreen or maximized output view is in an
output that has been unplugged, the coordinates don't make sense
anymore. In that case, invalidate them and use the initial position
algorithm when changing them back to the basic state.

Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16 17:23:08 -08:00
Giulio Camuffo 1aaf3e42e2 sdk: make C++11 plugins build again
compositor.h must not define a 'static_assert' macro, since that
conflicts with the new 'static_assert' in the standard and breaks
the build.
2013-12-09 16:20:48 -08:00
Jasper St. Pierre cf389f5917 Update .gitignore 2013-12-09 12:15:41 -08:00
Jasper St. Pierre 8f180d44f5 shell: Fix set_transient_for with a NULL parent 2013-12-09 11:34:09 -08:00
Kristian Høgsberg 8d344a0548 shell: Make sure the shell implementation and protocol versions match 2013-12-08 22:27:11 -08:00
Kristian Høgsberg c8f8dd894e desktop-shell: Drop next_type from shell_surface
The surface type now no longer changes and we track pending state changes in
next_state.  Instead of testing type != next_type to detect changes in
state, we just look at state_changed.
2013-12-05 23:20:44 -08:00
Kristian Høgsberg 4804a301db shell: Put xwayland surface at the top of the fullscreen layer
An xwayland surface corresponds to a override-redirect window under X,
which is typically a menu or a popup window.  They typically appear
with a keyboard and mouse grab and by nature of being override-redirect
these window can appear anywhere on screen and in the stack.

We need to resort to heuristics to decide where to place the
override-redirect in our surface stack, and for now we'll just put it on
top of everything.  That's going to be correct for almost all cases of
clicking to open a menu, but we can revisit and refine if we run into
a case that needs better handling.
2013-12-05 22:43:03 -08:00
Kristian Høgsberg 41fbf6f7fd desktop-shell: Make set_toplevel() clear surface states
This is used from wl_shell and xwayland and we need to make sure
xwayland also gets this behavior.
2013-12-05 22:31:25 -08:00
Kristian Høgsberg e960b3f012 desktop-shell: Set fullscreen flags in common code path
Just as for set_maximized() we can move the setting of the fullscreen and
state_changed flags into the common set_fullscreen() function.  This
function is also used from the xwayland wm to set fullscreen windows, and
with this change that now works again.
2013-12-05 22:04:42 -08:00
Kristian Høgsberg c2745b14f0 desktop-shell: Set maximized flags in common code path
We can set the maximized and state_changed flags in set_maximized(),
which is shared between shell_surface_set_maximized() and
xdg_surface_set_maximized().
2013-12-05 22:00:40 -08:00
Rafael Antognolli 5031cbe7b4 shell: Don't try to switch to a NULL shell surface.
Fixes the crash from alt+tab when there's a fullscreen surface.
2013-12-05 15:37:29 -08:00
Rafael Antognolli db59f9a53f shell: Set a surface as TOPLEVEL instead of the old surface types.
Since internally there's no more SHELL_SURFACE_FULLSCREEN and
SHELL_SURFACE_MAXIMIZED, the surface must be set to
SHELL_SURFACE_TOPLEVEL on the respective functions.

This fixes the bug when clients start already in fullscreen mode. In
that case, they aren't set first to toplevel, and then change to
fullscreen. They are set as fullscreen directly, not receiving the
SHELL_SURFACE_TOPLEVEL type on the set_fullscreen function.
2013-12-05 15:15:11 -08:00
Rafael Antognolli 44a3162eea shell: Add missing break to a case statement inside set_surface_type.
This should fix the surface not going back to its original position
after unsetting fullscreen or maximized states.

https://bugs.freedesktop.org/show_bug.cgi?id=72321
2013-12-05 12:02:36 -08:00
Kristian Høgsberg b7fd89192f build: Fix out-of-tree build for desktop-shell 2013-12-04 12:57:02 -08:00
Rafael Antognolli ba5d2d76af shell: Fix activate logic on surface map.
It should activate the newly mapped surface if not locked.
2013-12-04 11:55:03 -08:00
Kristian Høgsberg 677a5f5ac2 desktop-shell: Split out input-panel code 2013-12-04 11:03:24 -08:00
Kristian Høgsberg 1ef231377c desktop-shell: Split out exposay immplementation 2013-12-04 10:20:02 -08:00
Kristian Høgsberg 19d1e6b185 desktop-shell: Move to new desktop-shell subdirectory 2013-12-04 10:20:02 -08:00