Commit Graph

1265 Commits

Author SHA1 Message Date
Eric Anholt cc3c79553a configure: Fix build on debian by avoiding bashisms in the test command. 2012-02-09 12:58:47 -05:00
Kristian Høgsberg 66b71a9f1b configure: Set release version 0.85.0 2012-02-09 11:20:33 -05:00
Kristian Høgsberg 1a2dd7cc4f Use dist-xz for tarballs 2012-02-09 11:20:33 -05:00
Kristian Høgsberg 29589e9880 Disable setuid install for distcheck 2012-02-09 09:23:34 -05:00
Kristian Høgsberg d0e6c6715c configure: Change project to weston, set version to 0.85 2012-02-09 09:23:23 -05:00
Kristian Høgsberg 1f6e316411 smoke: Use normal window resize mechanism 2012-02-08 15:27:07 -05:00
Kristian Høgsberg 7ff7838a55 window: Don't set the window size in widget_set_size()
We propagate the toplevel widget size to the window size in the
window.c resize code.
2012-02-08 15:27:05 -05:00
Juan Zhao fd143aa2f6 smoke: fix the segment fault error
Add widget_set_size in the initiate time to allow smoke get the
correct surface later. Or it will report segment fault error because
of the null surface.

Also add resize_handler to not allow resizing just like flower.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-02-08 15:27:01 -05:00
Kristian Høgsberg 9e3aa72835 cairo-util: Only look at first two bytes for jpegs
The next two bytes aren't fixed.
2012-02-08 15:26:43 -05:00
Peter Hutterer d724526db2 terminal: run $SHELL if set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 15:26:40 -05:00
Jesse Barnes 097b13ec15 configure.ac: fix cairo-glesv2 help text
Finally figured out why --enable-cairo-gles2 wasn't working like
configure --help said it should.
2012-02-08 15:26:37 -05:00
Pekka Paalanen 8b0f045b04 configure: add libpng to client libs
http://lists.freedesktop.org/archives/wayland-devel/2012-January/001975.html
reports a linking problem:

/usr/bin/ld: libtoytoolkit.a(cairo-util.o): undefined reference to
symbol 'png_set_filler@@PNG12_0'
/usr/bin/ld: note: 'png_set_filler@@PNG12_0' is defined in DSO
/usr/lib/i386-linux-gnu/libpng12.so.0 so try adding it to the linker command line
/usr/lib/i386-linux-gnu/libpng12.so.0: could not read symbols: Invalid
operation
collect2: ld returned 1 exit status
make[3]: [weston-terminal] Error 1 (ignored)

A similar problem is diagnosed here:
http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html

As some distros are shipping linkers, that do not resolve symbols from
implicitly linked libraries, check and link libpng explicitly.

Cc: nerdopolis <bluescreen_avenger@verizon.net>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-08 15:26:20 -05:00
Kristian Høgsberg efa58a9472 compositor-wayland: Hide cursor for compositor surfaces 2012-02-08 15:26:11 -05:00
Kristian Høgsberg eff9c0d2ea compositor-wayland: Destroy wl_callback in callback function 2012-02-08 15:26:05 -05:00
Kristian Høgsberg f673994dc5 compositor: Drop setuid when launching clients 2012-02-08 15:26:00 -05:00
Pekka Paalanen 89d714f7c5 configure: toytoolkit GL apps depend on cairo-egl
Do not build toytoolkit applications that use GL, if Cairo-egl is not
available. These applications (which happen to be also the full GL
clients) do not work at all without Cairo-egl, and fail at runtime with
"unable to acquire window surface".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-08 15:25:04 -05:00
Scott Moreau 26fdb6d0cd Update config files to reflect new terminal name, weston-terminal
krh: Updated to use /usr/bin/weston-terminal.
2012-02-08 15:24:38 -05:00
Kristian Høgsberg ec4db94e9c compositor: Allow attaching null buffer
Attaching a null buffer is allowed and takes the surface back to the
unattached state it starts in.
2012-02-08 15:24:34 -05:00
Scott Moreau c03f96b5b0 Implement CONFIG_KEY_UNSIGNED_INTEGER
strtol() does not work when trying to assign 32 bits of data into a
regular signed int on 32 bit systems. Use corresponding strtoul()
instead.
2012-01-27 15:40:18 -05:00
Pekka Paalanen 0226011f58 desktop-shell: print what failed on exec
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 15:14:06 -05:00
Ander Conselvan de Oliveira fe0e155eb5 window: fix resizing of windows backed by shm buffers
When window_attach_surface() calls window_get_resize_dx_dy(),
window->resize_edges is cleared. However if there is already a pending
surface to be attached, the resize won't be done until the following
call to window_attach_surface(). In this next call, since resize_edges
is now zero, the top-left corner of the window will be unchanged. If
the user is resizing from the top or left border, this causes the
resize to happen in the wrong direction.

This patch changes window_attach_surface() to call
window_get_resize_dx_dy() only if an attach will actually happen.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-01-27 15:14:04 -05:00
Kristian Høgsberg 4ca85dccbb window: Handle data_device.selection events with offer=NULL
This happens when the current selection data_offer is removed.
2012-01-27 15:14:02 -05:00
Kristian Høgsberg 7a407678b3 cairo-util: Don't anger png.h by including setjmp.h
Older libpngs are a bit fussy about this, apparently.
2012-01-26 11:32:30 -05:00
Kristian Høgsberg ed7bc3b2d8 window: Don't crash when window with focus_widget is destroyed
We would try to deliver a leave event to a widget in a destroyed window.
2012-01-26 11:31:02 -05:00
Kristian Høgsberg 6af8eb9c7f desktop-shell: Build in sensible defaults
This adds a default background pattern and a terminal launcher in case
we don't have a config file.
2012-01-25 20:53:08 -05:00
Kristian Høgsberg 07f729441e desktop-shell: Support tiling of background images 2012-01-25 16:34:36 -05:00
Kristian Høgsberg d654876510 cairo-util: Add png loader and image type sniffing 2012-01-25 16:30:48 -05:00
Kristian Høgsberg 8129bc0fb9 desktop-shell: Fall back to solid color if there's no background image 2012-01-25 14:55:33 -05:00
Kristian Høgsberg ffe3bba13e cairo-util: Return NULL instead of exit() on jpeg load failure 2012-01-25 14:54:26 -05:00
Kristian Høgsberg a97eca95d0 Install terminal as weston-terminal 2012-01-25 14:02:05 -05:00
Kristian Høgsberg bcecca49b8 Revert "weston: Drop priviledges early, and seteuid when needed"
This reverts commit fc6ccb868f.

We still need root permissions for drmDrop/SetMaster.  Without
integration with ConsoleKit or systemd we also don't have access
to /dev/dri/cardX in the case where we open a new VT.
2012-01-24 12:41:19 -05:00
Benjamin Franzke fc6ccb868f weston: Drop priviledges early, and seteuid when needed 2012-01-24 11:26:41 -05:00
Benjamin Franzke ef548fd3ca setuid: Operate relative to $(DESTDIR) 2012-01-24 11:25:16 -05:00
Neil Roberts 6b28aadd47 window: Fix sending button events when there's no grab
The code which sends the button events was checking whether there is a
focus widget with a button handler but then always sending the button
event to the grab widget. If the grab widget is different from the
focus widget at this point then it will check the wrong widget for a
button handler and potentially crash. It is also possible for there to
be no grab widget here in the following situation:

1. Press and hold down the left mouse button
2. Press and hold down the right mouse button
3. Release the left mouse button
4. Release the right mouse button

In this case the grab will be released at step 3 because the code only
keeps track of the grab for one button. Then it will try to send the
release event for the right mouse button to a NULL widget so it will
crash.
2012-01-24 11:25:15 -05:00
Tiago Vignatti a12d6113ce evdev: fix uninitialised pointer value
==30224== Conditional jump or move depends on uninitialised value(s)
==30224==    at 0x40EE3A0: evdev_flush_motion (evdev.c:284)
==30224==    by 0x40EE6DC: evdev_input_device_data (evdev.c:352)
==30224==    by 0x4034710: wl_event_source_fd_dispatch (event-loop.c:76)
==30224==    by 0x4035171: wl_event_loop_dispatch (event-loop.c:462)
==30224==    by 0x4032F76: wl_display_run (wayland-server.c:785)
==30224==    by 0x8050972: main (compositor.c:2183)

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-01-20 13:35:27 -05:00
Kristian Høgsberg 5f5324e098 gears: Make window transparent
We need this for the window decorations.
2012-01-19 14:05:21 -05:00
Kristian Høgsberg 824c6d0e38 window: Use CAIRO_OPERATOR_OVER for rendering the menu
We forgot to switch back from CAIRO_OPERATOR_SOURCE, which is broken,
but also hits a broken fallback in cairo-gl.
2012-01-19 13:54:11 -05:00
Kristian Høgsberg 44d4de656b configure: Add --enable-setuid-install
This adds support for installing the compositor setuid.
2012-01-19 13:32:17 -05:00
Pekka Paalanen 8423a89d41 compositor: initialise segv_action.sa_mask
Valgrind complained sa_mask member is not initialised, fix that.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 10:19:02 -05:00
Pekka Paalanen 9e30a82e25 desktop-shell: don't crash on menu
Add dummy menu callback function, so we don't crash after every time
someone opens the menu.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 10:19:01 -05:00
Pekka Paalanen cb108439d2 shell: deal with weston_compositor_pick_surface() = NULL
I could crash Weston by trying to open another menu from a panel while
one menu from it was already showing.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff40a9872 in popup_grab_focus (grab=0x761968, time=4130706528, surface=0x0, x=-227, y=15) at shell.c:440
440		if (surface->resource.client == client) {
(gdb) bt
 0  0x00007ffff40a9872 in popup_grab_focus (grab=0x761968, time=4130706528, surface=0x0, x=-227, y=15) at shell.c:440
 1  0x0000000000406977 in weston_device_repick (device=0x70b4e0, time=4130706528) at compositor.c:360
 2  0x0000000000406a36 in weston_compositor_repick (compositor=0x619960) at compositor.c:382
 3  0x0000000000406ac8 in destroy_surface (resource=0x6fc6f0) at compositor.c:397
 4  0x00007ffff7bd33d8 in destroy_resource (element=0x6fc6f0, data=0x7fffffffd9fc) at wayland-server.c:355
 5  0x00007ffff7bd8d98 in for_each_helper (entries=0x757808, func=0x7ffff7bd332c <destroy_resource>, data=0x7fffffffd9fc)
    at wayland-util.c:264
 6  0x00007ffff7bd8dd4 in wl_map_for_each (map=0x757808, func=0x7ffff7bd332c <destroy_resource>, data=0x7fffffffd9fc)
    at wayland-util.c:270
 7  0x00007ffff7bd34dc in wl_client_destroy (client=0x7577d0) at wayland-server.c:385
 8  0x00007ffff7bd2e36 in wl_client_connection_data (fd=17, mask=1, data=0x7577d0) at wayland-server.c:187
 9  0x00007ffff7bd5bde in wl_event_source_fd_dispatch (source=0x74cda0, ep=0x7fffffffdae0) at event-loop.c:76
 10 0x00007ffff7bd665b in wl_event_loop_dispatch (loop=0x618900, timeout=-1) at event-loop.c:462
 11 0x00007ffff7bd42a9 in wl_display_run (display=0x6188b0) at wayland-server.c:785
 12 0x000000000040b1e1 in main (argc=1, argv=0x7fffffffdef8) at compositor.c:2182

Modify popup_grab_focus() to deal with a NULL surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 10:18:49 -05:00
Pekka Paalanen 6d174cff7a window: menu leak fixes
When a menu self-destructs, free also the widget and struct menu.

As menus are self-destructing, it does not make sense to store the
window pointer, since we cannot clear it automatically. Therefore,
rename window_create_menu() to window_show_menu() that does not return
the window pointer. It also calls window_schedule_redraw() internally.

Fixes Valgrind reported memory leaks.

The alternative would be to explicitly destroy the menu in application's
menu callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:42:05 +02:00
Pekka Paalanen 84d62dc999 resizor: free the widget on destroy
Plugs a memory leak.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:59 +02:00
Pekka Paalanen e156fb681e window: remove pointers to widget on destroy
Input devices may hold a pointer to the widget being destroyed. Reset
such pointers in widget_destroy().

This fixes a use-after-free in window_destroy(), if an application
destroys its widgets before the window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:55 +02:00
Pekka Paalanen 4dde2fc6f6 window: destroy frame in window_destroy()
Fix a memory leak reported by Valgrind, by destroying the window
decorations widget, if it exists.

All widget pointers returned from toytoolkit to the application should
be destroyed by the application explicitly.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:48 +02:00
Kristian Høgsberg 90b53815ba compositor: Flush surface damage to surface below on destroy
When we destroy a surface, we damage the surface below so that the area
exposed by the disappearing surface will be repainted.  However, if that
surface also is destroyed, the damage information is lost and we fail to
repaint that area.

This commit introduces weston_surface_flush_damage(), which flushes the
surface damage the the surface below when a surface is destroyed.  When
multiple surfaces are destroyed at the same time, the damage now accumulates
and sinks down through the surface stack as it should.
2012-01-18 21:41:37 -05:00
Kristian Høgsberg 6916d9cb6f drm: Don't print warning if cursor stride isn't right
gbm_bo_create_from_egl_image() should catch this based on the
GBM_BO_USE_CURSOR_64X64 flag.  It currently doesn't so we end up with
a cursor buffer with invalid stride.
2012-01-18 15:21:28 -05:00
Kristian Høgsberg 2d57439592 clients: Allow compiling with the cairo glesv2 backend
This disables gears and wscreensaver, which use full GL.
2012-01-18 14:50:58 -05:00
Pekka Paalanen 40e49ac7b5 desktop-shell: fix the unlock dialog decorations
The decorations were not responding, could not move or resize the
dialog, and it painted with a black shade.

When the dialog is created, schedule a resize instead of a repaint. The
resize will initialise the widget tree, and let everything draw and work
as it should.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-18 13:09:56 -05:00
Kristian Høgsberg 08fcbf0f3d tty: Use SIGUSR1 for both enter and leave signals
Now that we track has_vt, we can use the same handler for both enter and leave.
2012-01-18 12:42:16 -05:00