Commit Graph

917 Commits

Author SHA1 Message Date
Rob Bradford
09252d4b5e desktop-shell: Refactor launcher configuration reading to avoid leaking 2013-07-30 11:06:42 -07:00
Rob Bradford
5ab9c75d59 window: Free the allocated display if we fail to setup libxkbcommon 2013-07-30 11:05:42 -07:00
Rob Bradford
c48c34d6fa tablet-shell: Avoid leaking the path on failed icon loading 2013-07-30 11:05:23 -07:00
Rob Bradford
c9213e7353 image: Free filename saved into structure on error path 2013-07-30 11:04:58 -07:00
Armin K
a02d154b13 autotools: Correctly prefix simple-egl client name 2013-07-30 10:56:42 -07:00
Bryce W. Harrington
3d2046ed4b screenshot: Drop extraneous 'is' to improve warning msg grammar
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-29 16:32:51 -07:00
Armin K
aac6021bc0 autotools: Add an option to install demo clients
This patch adds a configure option which will enable
user to install demo clients if desired. It is disabled
by default.

v2: Remove AC_DEFINE as it is not necesary
2013-07-29 10:51:19 -07:00
Armin K
77ab1721b8 autotools: Rename demo clients
Prefix demo clients names with weston-, so they can
be installed if user desires.
2013-07-29 10:51:15 -07:00
Kristian Høgsberg
4162483d74 window.c: Simplify window_create() 2013-07-25 16:53:10 -07:00
Kristian Høgsberg
b886212545 Use xmalloc in desktop-shell.c 2013-07-25 16:44:45 -07:00
Kristian Høgsberg
8eeb30b9d1 window.c: Use xmalloc for frame_create() 2013-07-25 16:25:15 -07:00
Kristian Høgsberg
9a6c48d0fd cliptest: Use xmalloc in cliptest 2013-07-25 16:24:36 -07:00
Kristian Høgsberg
ce27841be5 clients: Introduce xmalloc() and use it a few places
For the sample clients we introduce xmalloc() to simplify OOM-handling.
This patch only converts a few callsites, but this will be our strategy
going forward.
2013-07-25 15:54:20 -07:00
Kristian Høgsberg
5addaa1820 simple-touch: Attach buffer before posting damage 2013-07-25 09:49:43 -07:00
Rob Bradford
5f087746ee window: Disregard motion events outside our current surface dimensions
It is possible to receive a motion event that was generated by the
compositor based on a pick of a surface of old dimensions. This was
triggerable on toytoolkit clients when minimising. The new window
dimensions were propagated through the widget hierarchy before the event
was dispatched.

This issue was triggering a segfault due to the focussed widget being
lost as the client code tried to identify which widget should have the
focus using co-ordinates outside the dimensions of the surface.

https://bugs.freedesktop.org/show_bug.cgi?id=66795
2013-07-13 00:00:49 -04:00
Rob Bradford
7000283741 editor: Support shift-left/right for selecting text
If the shift modifier is active then we don't make the cursor and the
anchor the same and as a result we develop a selection in the direction
that the arrow key gets pressed in.

https://bugs.freedesktop.org/show_bug.cgi?id=66802
2013-07-12 23:56:18 -04:00
Rob Bradford
3c9d967688 window: Allow popup menu when the window is maximised
https://bugs.freedesktop.org/show_bug.cgi?id=66793
2013-07-12 23:56:18 -04:00
Peter Maatman
b9a23f4fb8 clients/editor.c: Draw cursor at correct verical position
With this patch, the editor cursor now moves up and down correctly
instead of having the top part stuck on the first line.
2013-07-09 19:43:53 -04:00
Peter Maatman
08c38d4bc5 clients/editor.c: Ignore ESC key
Otherwise, editor would print the "unknown UTF-8 glyph" boxes.
2013-07-09 19:41:12 -04:00
Kristian Høgsberg
919cddb0ab Convert to wl_global_create/destroy() 2013-07-09 02:02:11 -04:00
Peng Wu
f291f20553 Use the average width of ASCII glyphs for cell width
As some CJK fonts are dual-width, calculate the average width of ASCII
glyphs and use that instead of the max_x_advance of the font.  This is
what VTE does too.

https://bugs.freedesktop.org/show_bug.cgi?id=63796
2013-07-08 17:57:59 -04:00
Ander Conselvan de Oliveira
e492549536 desktop-shell: Don't crash on output hotplug
The panel and background were never created for hotplugged outputs and
since some parts of the code assume that they always exist that would
lead to desktop-shell client to crash in that case.

This was easier to spot when the display was locked, because Weston
respawns the shell client and the user might not notice since there is
no flicker.

https://bugs.freedesktop.org/show_bug.cgi?id=66531
2013-07-05 16:48:32 -04:00
Ander Conselvan de Oliveira
6d75da7906 desktop-shell: Adapt to the new config parser API
This lets the code for adding panel launchers and setting up the
background to be moved into panel_* and background_* functions.

Note that this changes the behavior of the default launcher. Before
this change a default launcher would be added only if there was no
config file. Now a launcher is also added if there is no valid
launcher section.
2013-07-05 16:47:29 -04:00
Jason Ekstrand
d27cb096ad window: Request version 3 of wl_compositor
Originally window.c was requesting version 1 but several clients were
calling version 2 and 3 events including the desktop shell itself.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-07-03 14:52:06 -04:00
Daiki Ueno
b08b3296b8 editor: Fix segfault when deleting the first character 2013-07-02 00:02:56 -04:00
Matt Roper
e61561fd9c toytoolkit: Allow operation without a keymap
In preparation for upcoming changes, we want to make sure that apps
written with the toy toolkit continue to operate properly if no XKB
keymap is received.  If there's no XKB keymap, then we shouldn't
try to figure out keyboard modifier states (since we probably don't
even have equivalents of PC-style modifiers).

Reviewed-by: Singh, Satyeshwar <satyeshwar.singh@intel.com>
Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
2013-06-28 19:54:53 -04:00
Kristian Høgsberg
1d7d8f0e95 nested: Fix direct access to resource->data 2013-06-25 16:15:27 -04:00
Kristian Høgsberg
88dab17b0e nested: Port away from old wl_resource API 2013-06-24 22:53:38 -04:00
Daniel Stone
c228e23b05 configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

[pq: rebased and converted more files]
2013-06-05 01:16:34 -04:00
Rob Bradford
14a7601340 weston-info: Report the seat name provided by the compositor 2013-06-05 00:17:48 -04:00
Armin K
a94e285be7 clients/nested: Fix compilation 2013-06-04 23:50:41 -04:00
U. Artie Eoff
a2326ed77f add fullscreen to .gitignore
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-06-04 23:20:22 -04:00
Kristian Høgsberg
1cc5ac34b5 clients: Nested compositor example
A wayland compositor doesn't provide a mechanism for buffer sharing between
clients.  Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations.  Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.

This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension.  The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.

In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c.  As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor.  The nested compositor doesn't even create a
listening socket.

The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.
2013-06-04 02:47:12 -04:00
Jan Arne Petersen
8ccb7cc258 editor: Do not commit/preedit after invalid delete
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:55 -04:00
Jan Arne Petersen
895a128ce1 editor: Improve checks on delete add asserts
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:52 -04:00
Jan Arne Petersen
9eaa8e51ca editor: Properly adjust cursor on delete
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:48 -04:00
Jan Arne Petersen
a96953dffa editor: Support deleting text in preedit_string
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:46 -04:00
Jan Arne Petersen
1c45b4a4a9 editor: Fix text selection
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:42 -04:00
Alexander Larsson
73469ed7e6 fullscreen: Add fullscreen testing client
This lets you try fullscreen in different methods, sizes, scales,
translations, etc. You can verify both output and input (via mouse over
of the rectangles).
2013-05-28 16:14:38 -04:00
Alexander Larsson
edddbd14ac Convert all scales to int32_t
The type changed in the protocol, so update weston for this.
2013-05-28 15:27:45 -04:00
Louis-Francis Ratté-Boulianne
6cd1de33ba toytoolkit: Make the window resizing optimization optional
Whether or not a shm pool is used for resizing is now configurable at
build time (--disable-resize-optimization).

[pq: removed an unnecessary hunk from the patch]
2013-05-22 18:07:30 -04:00
Pekka Paalanen
a402b0567f desktop-shell: new wallpaper mode scale-crop
Scale-crop mode scales the wallpaper to tightly fill the whole output,
but preserving wallpaper aspect ratio. If aspect ratio differs from the
output's, the wallpaper is centered cutting it from top/bottom or
left/right.

Add this to the weston.ini man page, and explain all three modes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-22 18:07:30 -04:00
Pekka Paalanen
79346ab3a5 shell: wait for desktop-shell init before fade in
On Raspberry Pi, weston-desktop-shell is so slow to start, that the
compositor has time to run the fade-in before the wallpaper is up. The
user launching Weston sees the screen flipping to black, the fbcon
fading in, and then the desktop popping up.

To fix this, wait for the weston-desktop-shell to draw
everything before starting the initial fade-in. A new request is
added to the private desktop-shell protocol to signal it. If a
desktop-shell client does not support the new request, the fade-in
happens already at bind time.

If weston-desktop-shell crashes, or does not send the 'desktop_ready'
request in 15 seconds, the compositor will fade in anyway. This should
avoid a blocked screen in case weston-desktop-shell malfunction.

shell_fade_startup() does not directly start the fade-in but schedules
an idle callback, so that the compositor can process all pending events
before starting the fade clock. Otherwise (on RPi) we risk skipping part
of the animation. Yes, it is a hack, that should have been done in
window.c and weston-desktop-shell instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-22 18:07:30 -04:00
Alexander Larsson
95289831a1 transformed: Add keyboard shortcuts to change transform
This makes it easy to test buffer_transform and buffer_scale handling.
left-right: rotate
space: toggle inverse
z: toggle scale between 1 and 2
2013-05-22 16:19:01 -04:00
Alexander Larsson
de79dd0485 terminal: Handle output transform
We pick the highest scale of any output the terminal is on, and the
transform from the last one it entered.
2013-05-22 16:18:57 -04:00
Alexander Larsson
d68f523f30 window: Add window_get_output_scale()
This lets you find the maximal scale for all the outputs a window
is on, which is useful for picking a buffer_scale.
2013-05-22 16:18:52 -04:00
Alexander Larsson
c584fa60d4 desktop-shell: Respect output scale and translate
We pick the window scale/tranform based on what the output uses, which means
we can avoid rotations in the compositor, and get sharper rendering
in scaled outputs.
2013-05-22 16:18:42 -04:00
Alexander Larsson
1818e31001 window: Store server_allocation in surface size
We used to just store the buffer size here which is not right if the
surface has a buffer_transform or a buffer_scale. To fix this we pass
the transform and scale into the toysurface prepare and swap calls and
move both the surface to buffer and the buffer to surface size
conversion there.

Without this interactive resize on the top or left sides of a transformed
or scaled surface will not work correctly.
2013-05-22 16:17:59 -04:00
Alexander Larsson
01441299b1 transformed: Use the scale factor from the output 2013-05-22 16:17:52 -04:00
Alexander Larsson
2aaa8b76cf window: Apply buffer_scale automatically in widget_cairo_create 2013-05-22 16:17:41 -04:00