Ander Conselvan de Oliveira [Wed, 30 Apr 2014 11:15:14 +0000 (14:15 +0300)]
shell: Don't map surfaces of type SHELL_SURFACE_NONE
When commit
07926d90 factored out the code that chooses in which layer
a surface is added to, it changed the behavior for surfaces with no
type. Instead of not adding it to any layer, the surface is added to
the current workspace.
This patch restores the old behavior.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77527
Jason Ekstrand [Tue, 22 Apr 2014 00:42:58 +0000 (19:42 -0500)]
desktop-shell: Properly handle seat hotplugging
Previously, desktop-shell would only create its internal shell_seat object
for each seat available when the desktop-shell module is loaded. This is a
problem any time seats are created dynamically. In particular, the Wayland
and RDP backends create seats on an as-needed basis and they weren't
getting picked up proprely by desktop-shell.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77649
Kristian Høgsberg [Tue, 29 Apr 2014 23:38:23 +0000 (16:38 -0700)]
desktop-shell: Remove unused variables
Emilio Pozuelo Monfort [Thu, 30 Jan 2014 13:01:10 +0000 (14:01 +0100)]
desktop-shell: Properly handle lowered fullscreen surfaces
lower_fullscreen_surface() was removing fullscreen surfaces from
the fullscreen layer and inserting them in the normal workspace
layer. However, those fullscreen surfaces were never put back in
the fullscreen layer, causing bugs such as unrelated surfaces
being drawn between a fullscreen surface and its black view.
Change the lower_fullscreen_surface() logic so that it lowers
fullscreen surfaces to the workspace layer *and* hides the
black views. Make this reversible by re-configuring the lowered
fullscreen surface: when it is re-configured, the black view
will be shown again and the surface will be restacked in the
fullscreen layer.
https://bugs.freedesktop.org/show_bug.cgi?id=73575
https://bugs.freedesktop.org/show_bug.cgi?id=74221
https://bugs.freedesktop.org/show_bug.cgi?id=74222
Kristian Høgsberg [Tue, 29 Apr 2014 23:03:54 +0000 (16:03 -0700)]
desktop-shell: Keep windows on screen when moving
We add a primitive constraining function to at least prevent users from
moving the window up under the panel.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73421
Kristian Høgsberg [Tue, 29 Apr 2014 22:15:45 +0000 (15:15 -0700)]
desktop-shell: Raise new windows over fullscreen apps
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74219
Kristian Høgsberg [Tue, 29 Apr 2014 22:01:16 +0000 (15:01 -0700)]
desktop-shell: End popup when starting a touch shell grab
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77345
Kristian Høgsberg [Tue, 29 Apr 2014 21:50:25 +0000 (14:50 -0700)]
desktop-shell: Reject resize if we're already grabbed
This rejects resizing a window that's currently being moved. This can
be done using a touch screen and a pointer or just two seats.
Kristian Høgsberg [Tue, 29 Apr 2014 21:47:46 +0000 (14:47 -0700)]
desktop-shell: Reject window move in common_surface_move()
We move the check for shsurf->grabbed from surface_move() and
surface_touch_move() up top common_surface_move()
Kristian Høgsberg [Tue, 29 Apr 2014 21:47:19 +0000 (14:47 -0700)]
window.c: Dismiss menu on touch up events
Kristian Høgsberg [Tue, 29 Apr 2014 21:30:44 +0000 (14:30 -0700)]
window.c: Also grab touch events when grabbing input
Kristian Høgsberg [Tue, 29 Apr 2014 21:19:20 +0000 (14:19 -0700)]
window.c: Prevent key event delivery while a grab is active
Ideally, we'll update the key event handling to deliver events to widgets,
but in the meantime, just blocking key event delivery while a grab is
active goes a long way.
Kristian Høgsberg [Tue, 29 Apr 2014 21:11:26 +0000 (14:11 -0700)]
window.c: Update pointer focus when taking a grab
Ander Conselvan de Oliveira [Tue, 29 Apr 2014 14:54:03 +0000 (17:54 +0300)]
shell: Fix crash when a client is destroyed during the resize grab
If a client exists during a resize grab, the resource for the shell
surface being resized is destroyed. The shell surface is not destroyed
immediately, however, because of the window close animation. In that
case, the compositor would crash trying to send configure events to
the surface being resized, since it would pass a NULL pointer to
wl_resource_post_event().
The code for the resize grab was already able to handle the surface
going away, so expand it to also handle the resource going away and
fix the crash.
https://bugs.freedesktop.org/show_bug.cgi?id=77344
Ander Conselvan de Oliveira [Tue, 29 Apr 2014 14:54:02 +0000 (17:54 +0300)]
shell: Fix memory leaks caused by the window close animation
In order to do the window close animation, a reference for a destroyed
surface is kept. However, the reference count was also increased for
unmapped surfaces, in which case the animation wouldn't run. Since the
reference count was decremented in the animation done function, it would
never be decreased for unmapped surfaces, causing them to not be
released.
The close animation also changed how shell surfaces are released. The
destroy function for its resource was changed to not deallocate the
surface, and instead keep it around until the animation finishes and
the weston surface is destroyed. The destruction should happen in the
destroy listener for the weston surface, but it wouldn't destroy the
shell surface in the case the resource was still valid, assuming that
it would be freed in the resource destroy function.
Bryce W. Harrington [Mon, 28 Apr 2014 18:44:08 +0000 (18:44 +0000)]
terminal: Convert all *alloc's to x*alloc's.
This ensures the allocation results are checked for NULL (out of
memory), and terminates the program in such a case.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Neil Roberts [Fri, 25 Apr 2014 12:19:37 +0000 (13:19 +0100)]
Simply the matrix calculation for zooming
In order to apply the zoom transformation to the output matrix, Weston was
doing the following:
• Create a temporary matrix to hold the translation
• Invert the translation matrix using weston_matrix_invert into
another temporary matrix
• Scale that matrix by the scale factor
• Multiply the current matrix with the temporary matrix
Using weston_matrix_invert to invert a translation matrix is over the top.
Instead we can just negate the values we pass to weston_matrix_translate.
Matrix multiplication is associative so creating a temporary matrix to hold the
scale and translation transform should be equivalent to just applying them
directly to the output matrix.
Neil Roberts [Wed, 23 Apr 2014 17:02:47 +0000 (18:02 +0100)]
clients/window: Don't remove the touch listener on a frame event
It looks like the handler for frame events from the wl_touch interface for
widgets may have been erroneously copied from the cancel handler so that it
removes all handlers as they are processed. I don't think this makes much sense
for the frame event. This was stopping the panel icons from being pushable with
touch events when using libinput since commit
1679f232e541489e. All that commit
does it make it start sending the frame events.
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:17 +0000 (15:11 +0300)]
input: Fix errors due to initializing input before creating outputs
Make sure that we don't map a device to an invalid output pointer and
intead remap devices when an output is created.
v2: fix the error with libinput too.
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:16 +0000 (15:11 +0300)]
evdev: Fix assertion error for unplugged output with paired touchscreen
If the output a touchscreen is paired to is unplugged, events coming
from it should be ignored. Commit
17bccaed introduced logic for that
in evdev_flush_pending_damage(). However, the break statements it
introduced would cause the assertion after the switch statement to
fail.
That function has the odd behavior that goto's are used to skip the
assertion after the switch statement and jump to the hunk of code that
marks the event as processed. Only in the case where the event type has
an invalid value the assertion should trigger. So this patch fixes the
problem by moving the assertion into the default case of the switch
and replacing the goto statements with break ones.
https://bugs.freedesktop.org/show_bug.cgi?id=73950
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:15 +0000 (15:11 +0300)]
evdev: Discard events from a touchscreen paired with an unplugged output
Commit
17bccaed intended to make the events coming from a touchscreen
paired with an unplugged output to be discarded, while an unpaired one
would just choose a different output. However, the logic was inverted
causing the opposite to happen.
Later in commit
161c6c56, the default behavior was changed to map an
output to a default output if the one specified via udev is not
present. This change is reverted by this patch.
v2: undo the change from commit
161c6c56.
v3: deal with libinput too.
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:14 +0000 (15:11 +0300)]
libinput: Don't process touch events for devices without a valid output
That would be the case of a touch screen mapped to an output that was
unplugged.
Jason Ekstrand [Tue, 22 Apr 2014 02:04:42 +0000 (21:04 -0500)]
pixman-renderer: Use width/height_from_buffer for buffer transforms
This fixes an issue in the pixman renderer where it would not render
surfaces correctly if both wl_viewport and wl_surface.set_buffer_transform
were used.
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Tue, 22 Apr 2014 01:56:46 +0000 (20:56 -0500)]
Use the correct width/height when transforming surfaces with viewports.
Previously, because of the wrong width/height,
weston_surface_to_buffer_* would return the wrong values when
wl_viewport was used in combination with wl_surface.set_buffer_transform.
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Bryce W. Harrington [Mon, 21 Apr 2014 23:51:03 +0000 (23:51 +0000)]
xwayland: Check zalloc return for out of memory situation
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Mon, 21 Apr 2014 23:51:02 +0000 (23:51 +0000)]
Check zalloc return for out of memory situation
Most zalloc calls in weston are checked, this fixes a handful that were
being ignored. As found by `grep -EIsr "[^x]zalloc\(" . -A1`
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Kristian Høgsberg [Tue, 22 Apr 2014 05:54:37 +0000 (22:54 -0700)]
desktop-shell: Only use default background if no background color is set
Previously we would only use the set background color if the
background-image value was explicitly set to empty or a non-existing
image. With this change, we only load the default background image
if there's no configure background image or background color. In case
of both an image and a color, the image takes precedence as before.
Jonas Ådahl [Sat, 12 Apr 2014 07:39:51 +0000 (09:39 +0200)]
libinput: Forward frame events to clients
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77353
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Hardening [Fri, 11 Apr 2014 07:06:58 +0000 (09:06 +0200)]
Check malloc result
This patch checks malloc was successfull and release resources if it
wasn't.
John Kåre Alsaker [Thu, 10 Apr 2014 18:05:17 +0000 (20:05 +0200)]
gl-renderer: Remove gl_renderer_interface from gl-renderer.h
The rationale here is, that this line would create an instance of
gl_renderer_interface in every compilation unit that included
gl-renderer.h. This is not necessary, and it can actually be harmful by
masking the real exported gl_renderer_interface symbol, if you added
another compilation unit to gl-renderer.so, causing a runtime failure in
loading it.
gl-renderer.c already creates the exported symbol.
U. Artie Eoff [Fri, 18 Apr 2014 16:30:07 +0000 (09:30 -0700)]
weston-info: fix log message typo
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Kristian Høgsberg [Mon, 21 Apr 2014 22:33:51 +0000 (15:33 -0700)]
editor: Remove unused variables
Manuel Bachmann [Fri, 18 Apr 2014 10:50:14 +0000 (12:50 +0200)]
editor: react on Enter, Tab, and Up-Down arrow keys
The editor will now insert new lines and tabulations when
pressing the corresponding keys on the virtual keyboard.
The Up and Down arrows can be used to navigate through
lines.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77496
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
U. Artie Eoff [Thu, 17 Apr 2014 14:53:26 +0000 (07:53 -0700)]
seat: don't break in notify_output_create
If more than one input device maps to the new output, then we need
to map all devices to that output... not just the first device.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77576
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Thu, 17 Apr 2014 14:53:25 +0000 (07:53 -0700)]
input: fix input device map to output if it doesn't exist.
If an input device wants to map to an output that does not
exist, then just map it to the first output.
Also, if a device is mapped to an output that gets unplugged then
it gets default mapped to the first output in the output destroy
listener. However, the original output destroy listener needs to
be removed before adding the new listener for the first output,
otherwise the list gets corrupted.
Later if the other output is plugged back in, we remap the device
to it. In that case, we should remove the destroy listener for
the first output.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77341
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Thu, 17 Apr 2014 14:53:24 +0000 (07:53 -0700)]
libinput-device: break after LIBINPUT_EVENT_TOUCH_UP
We need to break after handling LIBINPUT_EVENT_TOUCH_UP otherwise
we fall into the default case and end up logging that the event
is unknown and then return the wrong "handled" result.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77577
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Thu, 17 Apr 2014 14:53:23 +0000 (07:53 -0700)]
libinput-seat: allow setting libinput log priority in weston
Look for WESTON_LIBINPUT_LOG_PRIORITY environment variable. If
it exists then use it to set the libinput log priority.
Otherwise, don't set the priority and get whatever libinput's
default priority is.
Setting WESTON_LIBINPUT_LOG_PRIORITY=0 allows us to log which
input devices are detected at Weston startup and makes it a
little more consistent with Weston's original evdev input setup
log messages... and useful for debugging and testing.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Thu, 17 Apr 2014 14:53:22 +0000 (07:53 -0700)]
libinput-seat: redirect libinput log to weston log
https://bugs.freedesktop.org/show_bug.cgi?id=77578
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Manuel Bachmann [Thu, 17 Apr 2014 12:04:32 +0000 (14:04 +0200)]
shell: display the input panel on the active output
We now dynamically move the input panel (i.e. virtual
keyboard) surface to the output containing the currently
focused surface.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71015
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Ander Conselvan de Oliveira [Thu, 17 Apr 2014 10:08:45 +0000 (13:08 +0300)]
compositor-drm: Fix crash when setting up seat constrained by an output
Commit
58e15865 changed the parameters for udev_get_seat_by_name() to
receive a struct udev_input. However, when this gets called from
create_output_from_connector() during initialization, the input struct
is not yet initialized, leading to a crash. Previously, that function
would take only a pointer to the compositor.
This patch fixes the crash by initializing input before creating any
outputs.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77503
Manuel Bachmann [Tue, 15 Apr 2014 10:38:31 +0000 (12:38 +0200)]
keyboard: add the missing symbols layout, fix arabic layout
The "symbols" modifier key of weston-keyboard is no longer
inactive, but will provide an additionnal layout with
numerals and special characters.
Fix the Arabic keyboard, which was rendering out of the
bounds, and now use the Arabic IBM PC keyboard as a
reference for its standard and new symbols layouts.
https://bugs.freedesktop.org/show_bug.cgi?id=71757
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:07 +0000 (15:48 +0300)]
shell: Destroy a previous input panel animation when showing it again
It is possible that an input panel will be shown quickly, hidden and
shown again, before the animation for the first appeareance finished.
In that case, another animation would be created and the effect of the
two combined could cause the panel to not appear in the screen.
This patch fixes this by keeping a reference to the previous animation
and deleting it when a new one is created.
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:06 +0000 (15:48 +0300)]
animation: Fix input panel slide animation
The position for the slide animation was calculated assuming the value
of the spring was always between 0.0 and 1.0. Commit
3a869019 broke
that assumption, and the result was that the panel would be positioned
at an invisible part of screen. Since there would be no output repaints
scheduled, the result of the animation would only be seen if something
else triggered a repaint (such as a mouse cursor movement).
This patch changes the values for the slide animation's spring to range
between 0.0 and 1.0, thus fixing the position of the panel and the lack
of scheduled repaints problem.
https://bugs.freedesktop.org/show_bug.cgi?id=77347
Ander Conselvan de Oliveira [Mon, 14 Apr 2014 12:48:05 +0000 (15:48 +0300)]
animation: Split spring setup out of weston_view_animation_run()
All the animations override at least one parameter of the spring that
is set during the creation of the animation. Some need to do the whole
setup again.
This patch changes the initialization of a view animation to a three
step process. First, the animation is created. Then the caller sets up
the spring and calls weston_view_animation_run() to apply the effect of
the animation for the first animation frame.
Marek Chalupa [Fri, 11 Apr 2014 09:48:55 +0000 (11:48 +0200)]
tests: fix bad-buffer-test
bad-buffer-test is FAIL_TEST and every assert() (or even SIGSEGV signal)
make it pass. It shouldn't be so for example when assert() is invoked
when a client couldn't connect to display.
Make sure that only relevant asserts make the test pass
and the other make it fail (by returning 0)
Jason Ekstrand [Thu, 17 Apr 2014 02:12:10 +0000 (21:12 -0500)]
desktop-shell: Get rid of get_shell_client
We now carry the shell_client around with each shell_surface. This is much
more reliable than tacitly assuming that there is only one wl_shell or
xdg_shell instance bound to a particular wl_client. In particular, weston
would crash when a client bound to both wl_shell and xdg_shell even if it
only ever used one of them.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Ander Conselvan de Oliveira [Wed, 16 Apr 2014 09:05:12 +0000 (12:05 +0300)]
compositor-drm: Pass the right stride to the vaapi recorder
It takes the stride in bytes, not pixels. The bug was hidden when using
va intel-driver 1.2.1 because it would ignore the stride from user and
set the surface state in a wrong way.
https://bugs.freedesktop.org/show_bug.cgi?id=77495
Ander Conselvan de Oliveira [Fri, 11 Apr 2014 10:57:15 +0000 (13:57 +0300)]
shell: Fix view repositioning logic for output move and destroy
Previously, the repositioning logic would iterate the compositor's list
of layers and move the views on those layers. However, that failed in
two different ways: it didn't cover hidden workspaces and crashed when
the display was locked.
This patch changes the logic to explicit iterate over all the layers
owned by the shell. The iteration is done through a helper function,
shell_for_each_layer().
https://bugs.freedesktop.org/show_bug.cgi?id=76859
https://bugs.freedesktop.org/show_bug.cgi?id=77290
Jason Ekstrand [Fri, 11 Apr 2014 08:42:59 +0000 (03:42 -0500)]
gl-renderer: Fix a typo in the output_set_border description
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jasper St. Pierre [Tue, 1 Apr 2014 23:55:26 +0000 (19:55 -0400)]
xwayland/launcher: Use %m instead of manual strerror(errno)
Bryce W. Harrington [Tue, 8 Apr 2014 21:04:57 +0000 (21:04 +0000)]
protocol: Correct typo 'suppot'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 13:36:57 +0000 (16:36 +0300)]
shell: Keep shsurf->fullscreen_output set after unset_fullscreen()
When a fullscreen surface gets the maximized state, the function
reset_surface_type() is called and that causes unset_fullscreen() to be
called. That function would set the value of shsurf->fullscreen_output
to NULL. However, since the surface still has the fullscreen state, it
will be configured as a fullscreen surface again, and an attempt to
access that field would cause the compositor to crash.
Fix the crash by keeping the value of fullscreen_output around after
unset_fullscreen(). This is safe since the value is only used when a
surface has the fullscreen state and is replaced on a new request to
make the surface fullscreen.
https://bugs.freedesktop.org/show_bug.cgi?id=76867
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 12:35:58 +0000 (15:35 +0300)]
shell: Damage below child surfaces on move to different workspace
When moving from a surface from visible workspace to an invisible one
via a popup menu, the area below the menu wouldn't be repainted.
https://bugs.freedesktop.org/show_bug.cgi?id=76973
Ander Conselvan de Oliveira [Thu, 10 Apr 2014 11:49:35 +0000 (14:49 +0300)]
shell: Disarm the screensaver timeout timer on terminate_screensaver()
The timer was left running after the screensaver was terminated. When
it triggered, a fade out that would in turn cause the screen to be
locked was started. Since that could happen without the compositor
emitting the idle signal, there would be no wake signal to make the
shell show the lock screen, so the system was left unresponsive
until the idle signal actually triggered.
https://bugs.freedesktop.org/show_bug.cgi?id=70923
Neil Roberts [Wed, 9 Apr 2014 15:33:32 +0000 (16:33 +0100)]
Reset the keyboard focus on all seats when the compositor is locked
Before commit
2f5faff7f9142 when the compositor is locked it would
reset the keyboard focus on all of the seats as part of pushing the
focus_state. This was removed because it now always keeps track of the
focus_state in the workspace instead of waiting until the state is
pushed. However this had the side effect that the active surface would
retain focus when the compositor is locked. This patch just makes it
explicitly set the keyboard focus to NULL on all of the seats when
locking. This will be restored based on the workspace's state when
unlocking.
https://bugs.freedesktop.org/show_bug.cgi?id=73905
Neil Roberts [Wed, 9 Apr 2014 15:33:31 +0000 (16:33 +0100)]
Reset focus on unknown seats when restoring focus state
The focus_state list on a workspace only contains entries for seats
which have a keyboard focus on that workspace. For workspaces that
have no surfaces the list will be empty. That means that when a
workspace with no surfaces is switched to it would previously leave
the keyboard focus unaffected and you could still type in the surface
on the old workspace.
This patch makes it instead reset the keyboard focus to NULL for seats
without a focus_state. It does this by temporarily stealing the
compositor's list of seats while it iterates the focus_states. After
all of the focus states have been processed any seats remaining in
this temporary list have their focus reset.
https://bugs.freedesktop.org/show_bug.cgi?id=73905
Ander Conselvan de Oliveira [Wed, 9 Apr 2014 14:39:39 +0000 (17:39 +0300)]
shell: Allow unresponsive surfaces to be moved again
Commit
c85f1d45 caused the move of an unresponsive surface to be no
longer possible, since the grabbed flag would prevent the move grab
to start while the busy grab was still active.
Daiki Ueno [Tue, 8 Apr 2014 09:46:18 +0000 (18:46 +0900)]
terminal: Don't try to render RLE used as a placeholder
weston-terminal uses RLE (U+202B) as a placeholder of the right half
of a double width character. However, not all fonts include this
glyph and cairo renders it as .notdef (glyph index 0) in that case.
Kristian Høgsberg [Mon, 7 Apr 2014 23:14:54 +0000 (16:14 -0700)]
configure.ac: Bump version to 1.4.91
Kristian Høgsberg [Mon, 7 Apr 2014 18:52:17 +0000 (11:52 -0700)]
desktop-shell: Activate surface on right click too
This raises the surface to the top on right click as well, which fixes
pop stacking.
https://bugs.freedesktop.org/show_bug.cgi?id=74831
Kristian Høgsberg [Mon, 7 Apr 2014 18:28:05 +0000 (11:28 -0700)]
window.c: Create xdg_surface up front
Fixes initial fullscreen for calibrator.
https://bugs.freedesktop.org/show_bug.cgi?id=76970
Andrew Wedgbury [Mon, 7 Apr 2014 11:40:35 +0000 (12:40 +0100)]
Make sure config.h is included before any system headers
There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.
The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h
Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
Kristian Høgsberg [Mon, 7 Apr 2014 17:16:19 +0000 (10:16 -0700)]
xwayland: Clean up unpaired surfaces
Mariusz Ceier [Mon, 7 Apr 2014 16:02:13 +0000 (18:02 +0200)]
Don't include xserver-server-protocol.h
It was removed in
757d8aff2757387bcd594e2ee2a27055b366eac3,
along with xserver protocol.
Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
Manuel Bachmann [Mon, 7 Apr 2014 09:58:45 +0000 (11:58 +0200)]
Fix on-the-fly transparency changes in pixman-renderer
This fixes :
- leaking the mask used to simulate transparency ;
- code style (definitions moved up, use of brackets) ;
- applying an opaque region when transparency is
wanted (shound not happen).
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Neil Roberts [Mon, 7 Apr 2014 14:01:01 +0000 (15:01 +0100)]
gl-renderer: Keep track of the GL format used for SHM buffers
If the client attaches a new SHM buffer with a different format from a
previous one then we ought to trigger a full upload so that GL can
allocate a new texture. Otherwise Weston would technically be doing
invalid operations because it would call glTexSubImage2D with a
different format from the one specified in glTexImage2D. Presumably it
would also mean GL would have to convert the buffer as it copies the
sub-region in which isn't ideal.
This patch makes it decide the GL format when the buffer is attached
instead of when processing the damage and it will set
needs_full_upload if it is different from what it used before.
Neil Roberts [Mon, 24 Feb 2014 19:07:08 +0000 (19:07 +0000)]
nested: Disable cairo on the subsurfaces
The subsurface widgets on the nested example aren't using Cairo to
render so we should turn it off to prevent the toy toolkit from
creating a redundant extra surface for it. This is particularly
important since Mesa commit
6c9d6898fdfd7e2 because the surface that
the toolkit tries to create is zero-sized and that patch prevents that
from working. This was causing weston-nested to crash.
Manuel Bachmann [Sat, 5 Apr 2014 03:31:37 +0000 (05:31 +0200)]
Support on-the-fly transparency changes in pixman renderer
When the alpha channel of a surface is changed and the surface
refreshed, pixman renderer will now apply a mask corresponding
to the alpha channel value.
This allows visual effects like shell fade in, shell fade out,
window switching, to work when using pixman renderer.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Bryan Cain [Fri, 4 Apr 2014 22:41:24 +0000 (17:41 -0500)]
shell: Fix segfault from trying to access a destroyed popup shell surface
The shell_destroy_shell_surface function only set the backing resource to
NULL, leaving an unusable surface in the popup_grab list until the surface's
fading animation finished and it could be freed. This caused a segfault if
the shell tried to forcibly break the grab during that time interval due to
the compositor losing the keyboard focus.
https://bugs.freedesktop.org/show_bug.cgi?id=77072
Jason Ekstrand [Fri, 4 Apr 2014 17:22:41 +0000 (12:22 -0500)]
compositor-rdp: Remove unneeded client->Close call
The client->Close call is unneeded as that is already implied by returning
FALSE.
Neil Roberts [Fri, 4 Apr 2014 15:24:54 +0000 (16:24 +0100)]
Always use glTexImage2D instead of glTexSubImage2D for first upload
Previously when uploading SHM data we would initialise the texture
with glTexImage2D and NULL data when the buffer is attached. Then if
the GL_EXT_unpack_subimage extension is available we would always use
glTexSubImage2D to upload the data. The problem with that is that the
first glTexImage2D was always setting the internal format to
GL_BGRA_EXT and then if a 16-bit texture is used we would later call
glTexSubImage2D with a data format of GL_RGBA. Under GLES2 the
internal format must always match the data format so this is
technically invalid.
This patch makes it so that it always calls glTexImage2D when flushing
the damage for the first time. That way it will use the right internal
format and we don't need to call glTexImage2D with NULL data.
https://bugs.freedesktop.org/show_bug.cgi?id=75251
Pekka Paalanen [Fri, 4 Apr 2014 11:22:13 +0000 (14:22 +0300)]
compositor: wl_viewport destination 1x1 min
Ensure, that the resulting surface size is at least 1x1, even when
destination size is not set and source size is zero. Previously this
lead to zero surface size.
This can still happen due to wl_viewport.set(#, #, 0, 0, #, #) followed
by wl_viewport.set_destination(-1, -1).
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 4 Apr 2014 11:22:12 +0000 (14:22 +0300)]
protocol: unify wl_viewport src and dst size rules
Let's make the source and destination size rules consistent: neither can
have zero, {-1, -1} disables it, and other negatives are not allowed.
The sanity of allowing zero sized source rectangle as debatable. Now the
minimum becomes 1/256x1/256, and with output_scale the actual samples
may be even smaller. That should be enough.
On not allowed values, raise a protocol error. This should help catch
bugs in clients that accidentally send garbage values.
The old wl_viewport.set request remains the same, and can still produce
zero sized source rectangle.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Manuel Bachmann [Fri, 4 Apr 2014 08:04:18 +0000 (10:04 +0200)]
toytoolkit: match parent surface type when adding a subsurface
When adding a subsurface (to display a tooltip) in toytoolkit,
we now get the parent window surface type (SHM or EGL) and
define the new surface type as the same.
This fixes crashes with tooltips in cases like having
Cairo-EGL available but running the X11 compositor.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 16:51:42 +0000 (11:51 -0500)]
screen-share: re-enable planes when finished
Kristian Høgsberg [Tue, 18 Mar 2014 05:33:29 +0000 (22:33 -0700)]
xwayland: Use new Xwayland DDX
Kristian Høgsberg [Mon, 7 Apr 2014 05:04:50 +0000 (22:04 -0700)]
compositor: Add create_surface_signal
This signal is emitted when a client creates a surface, not for internal
surfaces.
Jason Ekstrand [Thu, 3 Apr 2014 00:54:01 +0000 (19:54 -0500)]
Add a screen sharing plugin
This adds a plugin called screen-share.so. If the screen-share.so module
is imported, it will add the CTRL+ALT+s keybinding to start a screen
sharing session. If you press CTRL+ALT+S, weston will spawn another copy
of weston, this time with the RDP backend, and mirrors the current screen
to it and adds any seats from RDP as aditional seats. The current screen
is defined as the one with the mouse pointer. Currently the CTRL+ALT+s
keybinding is hardcoded as the only way to activate screen sharing. If, at
some point, shells want more control over the screen sharing process, the
API's should be easy to update and export to make this possible.
For security, the command and path to weston is currently hard-coded. It
would not take much aditional code to make this configurable or to allow a
shell to launch other screen-sharing programs. However, handling those
security issues is outside the scope of this patch so it is hard-coded for
now.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Hardening [Thu, 3 Apr 2014 00:54:00 +0000 (19:54 -0500)]
compositor-rdp: Add an option to disable client initiated resizes
This patch adds an option to the RDP compositor to disable
desktop resizes initiated by RDP peer. The current behaviour
is that if an incoming RDP peer suggests a resolution that is
not the current one, a mode_switch() is done and the desktop is
resized to that new resolution. This new flag allows to disable
that behaviour. If the flag is set, the new behaviour is that the
RDP peer will be instructed to resize to the size of the desktop.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:59 +0000 (19:53 -0500)]
gl-renderer: Fix read_pixels in the case where we have output borders
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:58 +0000 (19:53 -0500)]
Add support for running with a primary client
On startup weston now detects the WAYLAND_SERVER_SOCKET environment
variable. If found, weston does not create the display like normal, but
instead directly adds a client corresponding to the given fd. This,
combined with the fullscreen shell, allows a process to spawn weston and
use it as a backend.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:57 +0000 (19:53 -0500)]
compositor-wayland: Properly handle running inside a compositor that does not provide keymaps
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:56 +0000 (19:53 -0500)]
Automatically select the wayland backend if WAYLAND_SOCKET is set
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:55 +0000 (19:53 -0500)]
compositor-wayland: Add a --sprawl option
This forces weston to create one output for every parent output. This is
enabled by default if it detects a wl_fullscreen_shell. The --sprawl
option is primarily to enable this on wl_shell.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:54 +0000 (19:53 -0500)]
compositor-wayland: Add support for running on top of wl_fullscreen_shell
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:53 +0000 (19:53 -0500)]
weston-fullscreen: Add cursor drawing support and properly handle WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:52 +0000 (19:53 -0500)]
weston-fullscreen: Add wl_fullscreen_shell support
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:51 +0000 (19:53 -0500)]
toytoolkit: Don't crash if wl_data_device_manager is not present
This is primaraly to get weston-fullscreen to run on compositors that lack
copy-paste support.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:50 +0000 (19:53 -0500)]
toytoolkit: Expose output make and model
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:49 +0000 (19:53 -0500)]
toytoolkit: Only require xdg_shell if the window is not custom
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:48 +0000 (19:53 -0500)]
simple-shm: Add wl_fullscreen_shell support
This makes simple-shm act like a very simple fullscreen shell client. This
is the kind of interaction one would expect out of a boot splash screen or
similar.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:47 +0000 (19:53 -0500)]
Add a wl_fullscreen_shell implementation
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:46 +0000 (19:53 -0500)]
Add possible capabilities CURSOR_PLANE and ARBITRARY_MODE
The CURSOR_PLANE capability indicates that the backend has a concept of a
cursor plane and can handle a cursor without compositing. This is currently
only advertised by the DRM backend.
The ARBITRARY_MODE flag specifies that the backend is capable of switching to
virtually any resolution. This is currently only advertised in the RDP
backend. While it's a bit buggy right now, it should be capable of this.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:45 +0000 (19:53 -0500)]
Add a signal for when a seat updates its capabilities
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:44 +0000 (19:53 -0500)]
Generate/build the fullscreen shell protocol files
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Thu, 3 Apr 2014 00:53:43 +0000 (19:53 -0500)]
Add a fullscreen shell protocol
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Giulio Camuffo [Wed, 11 Dec 2013 22:45:12 +0000 (23:45 +0100)]
compositor: let the shells create the screenshooter
Giulio Camuffo [Wed, 11 Dec 2013 22:45:11 +0000 (23:45 +0100)]
compositor: add an exported function to take a screenshot of an output
This allows other screenshooter protocols to use the same code to copy
the screen to a buffer.
Manuel Bachmann [Wed, 5 Mar 2014 11:21:34 +0000 (12:21 +0100)]
shell: position input panel layer above fullscreen layer
When a client calls the input panel (weston-keyboard e.g.)
and then goes fullscreen, the panel will not be hidden
anymore.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Manuel Bachmann [Wed, 26 Feb 2014 14:53:11 +0000 (15:53 +0100)]
compositor: use Mod-Tab to show/raise minimized surfaces
Temporarily show minimized surfaces when switching between
surfaces with the keyboard. If the final selected one was
minimized, it will be restored.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>