Commit Graph

52 Commits

Author SHA1 Message Date
Kristian Høgsberg bcacef19b0 Add an option parser
On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
2012-03-12 01:28:50 -04:00
Kristian Høgsberg 41c5c4ee9a desktop-shell: Simplify unlock dialog redraw function 2012-03-05 20:37:51 -05:00
Rodney Lorrimar 99ff01b816 weston: Change path for default terminal launcher to ${prefix}/bin
If you don't have anything at ~/.config/weston-desktop-shell.ini and
have weston installed somewhere other than /usr, then this patch will
help.

Cheers,

Signed-off-by: Rodney Lorrimar <rodney@rodney.id.au>
2012-02-29 12:43:05 -05:00
Kristian Høgsberg 009ac0a965 window: Dont take width and height in window constructor
Always set this by scheduling an initial resize.
2012-01-31 15:24:48 -05:00
Scott Moreau fa1de69203 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:34:27 -05:00
Pekka Paalanen a291ae55b0 desktop-shell: print what failed on exec
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 11:33:07 -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
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 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 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 b63235142d window: Move focus widget to struct input 2012-01-11 00:04:42 -05:00
Kristian Høgsberg 29af3ebce6 window: Make decorations just a widget
Woohoo, only took 25 commits of refactoring to get to this point.
2012-01-10 22:41:55 -05:00
Kristian Høgsberg bb97700474 window: Get rid of the window child allocation concept 2012-01-10 19:11:42 -05:00
Kristian Høgsberg 441338cb75 window: Keep widgets in a tree instead of a list 2012-01-10 14:22:14 -05:00
Kristian Høgsberg b67e94b170 window: Make resize and redraw handlers widget vfuncs 2012-01-10 14:22:10 -05:00
Kristian Høgsberg 5d12990dbe window: Allocate and flush the window surface in window.c
No need to push this to the toolkit users.
2012-01-10 12:25:32 -05:00
Kristian Høgsberg 75bc667a70 window: Drop the window widget
It was just a temporary convenience for moving things over.
2012-01-10 10:45:52 -05:00
Kristian Høgsberg bb901fac90 window: Return pointer type from widget enter handler 2012-01-09 11:22:32 -05:00
Kristian Høgsberg 5388080949 desktop-shell: Rename panel_widget to panel_launcher 2012-01-09 11:16:50 -05:00
Kristian Høgsberg a8a0db3497 window: Move button handler to widget 2012-01-09 11:12:05 -05:00
Kristian Høgsberg ee143236d7 window: Replace widget focus handler with a enter/leave handler pair 2012-01-09 08:42:24 -05:00
Kristian Høgsberg 9a13dab8a9 window: Move widget focus handler to the widget 2012-01-08 15:18:19 -05:00
Kristian Høgsberg c51f79954b window: Rename item to widget
It's a widget.
2012-01-08 15:09:53 -05:00
Kristian Høgsberg 4f7dcd6eb1 window: Add a window menu
At least this gives us a way to close the toy toolkit clients.
2012-01-06 22:03:44 -05:00
Kristian Høgsberg b3cca0a411 shell: Start implementing the popup surface type
This lands the basic behavior of the popup surface type, but there are still
a number of details to be worked out.  Mainly there's a hardcoded timeout
to handle the case of releasing the popup button outside any of the
client windows, which triggers popup_end if it happens after the timeout.
Maybe we just need to add that as an argument, or we could add a new event
that fires in this case to let the client decide whether it ends the popup
or not.
2012-01-06 11:41:55 -05:00
Kristian Høgsberg 9724b51750 More weston rename fixes 2012-01-03 14:35:49 -05:00
Kristian Høgsberg 9b935c8239 Use '-' to separate words in file names
Eventually we will want more functionality in the shared library and we
will rename it at that point.  Perhaps we'll name it libnih, but for now
let's stick with libconfig-parser.
2011-12-08 12:44:27 -05:00
Pekka Paalanen fd83b6d70f desktop-shell: add option to not use locking
Add an option to the desktop-shell ini file that defines whether screen
locking is used or not.

Useful for testing screensaver interactions without a lock surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:26:46 +02:00
Pekka Paalanen c1765c67b3 move config parser to a convenience library
Create a new directory for convenience librariers that can be shared
between compositor components and clients.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:25:12 +02:00
Pekka Paalanen 02dfb75145 desktop-shell: no need to unset WAYLAND_SOCKET
As of commit "client: unset WAYLAND_SOCKET env variable",
58bb064afa3bfc706e3b30dd170804235aa272ea, in the Wayland core, the
Wayland library will unset the environment variable automatically.

No need to explicitly unset it again here.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-07 08:50:34 +02:00
Pekka Paalanen 068ae944db desktop-shell: update protocol and client to wl_shell_surface
Change desktop-shell protocol to use wl_shell_surface instead of
wl_surface.

Adapt the desktop-shell client and the shell plugin.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:34 -05:00
Benjamin Franzke d0f79ab5ab desktop-shell: Make panel and background output dependent 2011-11-23 20:17:54 +01:00
Benjamin Franzke 8193bc1e9a desktop-shell: Unlock dialog needs to be a custom window
Since set_toplevel would overwrite set_lock_surface.
2011-11-23 19:36:28 +01:00
Benjamin Franzke d775971e94 desktop-shell: Fix some indents 2011-11-23 17:19:38 +01:00
Pekka Paalanen 50719bce2a Fix inconsistent #include style
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-22 09:27:03 -05:00
Kristian Høgsberg 1ec0c31596 compositor: Hide surfaces by setting surface->output to NULL
This way we can still use surface->link when a surface is not in
the main compositor surface list and don't need the hidden_surface
wrapper object.  Also, setting surface->output to NULL will block
the surface frame callback until we put the surface back into the
main list.  This has the effect of blocking animations while a surface
isn't visible.
2011-11-15 16:43:25 -05:00
Pekka Paalanen bfbb26bdb2 desktop-shell: add unlock dialog
The unclock dialog is just a normal window with a green ball in it. When
you click the ball, the screen will be unlocked.

Made for testing the screen locking.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-15 16:43:25 -05:00
Pekka Paalanen 9ef3e012d6 desktop-shell: screen locking protocol
Add protocol and functions for supporting screen locking, triggered by
activity timeout.

After activity timeout, compositor starts the fade to black, and then
enters SLEEPING state. At that point it calls lock() in the shell
plugin.

When input events trigger a wakeup, unlock() in the shell plugin is
called. This sends prepare_lock_surface event to the desktop-shell
client. The screen stays locked while the compositor starts fade-in.

At this point, desktop-shell client usually creates a surface for the
unlocking GUI (e.g. a password prompt), and sends it with the
set_lock_surface request. The compositor supposedly shows and allows
interaction only with the given lock surface (not yet implemented).

When desktop-shell has authenticated the user, or instead of issuing
set_lock_surface, it sends the unlock request. Upon receiving the unlock
request, the shell plugin unlocks the screen.

If desktop-shell client dies, the screen is unlocked automatically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-15 14:18:50 -05:00
Kristian Høgsberg fc32c394e7 config: Don't print warning when XDG_CONFIG_HOME isn't set
According to the spec, it's ok for this not to be set and just means that
we should default to $HOME/.config.
2011-11-15 09:02:24 -05:00
Pekka Paalanen 668dd56918 window: add a helper for config file paths
Add a helper function, that constructs a path to a config file from
XDG_CONFIG_HOME environment variable, by the rules of
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Make desktop-shell find its config file from XDG_CONFIG_HOME. This
allows to have a personal config file without continuously fighting with
git about wayland-desktop-shell.ini.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-15 08:57:01 -05:00
Kristian Høgsberg ac3a59a0d1 window: Add a cheesy parser for ini-files, use it in desktop-shell 2011-11-14 22:51:02 -05:00
Pekka Paalanen 6cd281a023 desktop-shell: launch from the compositor
Fork and exec desktop-shell in the compositor. This is a way to create
an authenticated client. Later, the desktop-shell interface will be
reserved for this client only.

For exec to work, the compositor should be started from the
wayland-demos' root directory.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-03 15:16:19 -04:00
Kristian Høgsberg 27d3866045 cairo-util: Add helper to load jpeg files 2011-10-20 13:11:12 -04:00
Kristian Høgsberg bcee9a4b25 desktop-shell: Add beginning of pop-up menu to panel 2011-10-12 00:36:16 -04:00
Kristian Høgsberg e28d05b0ad window.c: Move window items to window.c 2011-09-20 21:43:54 -04:00
Kristian Høgsberg 3a69627f43 window: Stop using glib mainloop in toy toolkit 2011-09-19 17:28:55 -04:00
Kristian Høgsberg 7e69000556 desktop-shell: Scale background image to output size 2011-09-08 18:18:02 -04:00