summaryrefslogtreecommitdiff
path: root/shared
AgeCommit message (Collapse)AuthorFilesLines
2014-09-22clients: Maximize window when double touch on title barXiong Zhang2-0/+56
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2014-09-11load_image: always print a message on failure if filename is not emptyBill Spitzak1-2/+12
It was rather inconsistent before. This may help users figure out why backgrounds and icons don't show up. A better api where the error can be queried might be nice, but this seems sufficient for current Weston use. [Pekka Paalanen: removed one stray space.] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11parse_options: fail on more malformed optionsBill Spitzak1-28/+69
Fail on trailing text after numbers, such as --width=100mm Fail on any text after booleans, such as --flag=false Also fixed reading of memory after the null terminator of a long option with no = sign in it. [Pekka Paalanen: some whitespace style fixes.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-04clients: Maximize window when double click on title barXiong Zhang2-0/+35
Signed-off-by: Xiong Zhang <panda0626@gmail.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-22tests: allow running make check without make installDerek Foreman2-0/+15
desktop shell and weston keyboard both refer to themselves prefixed by LIBEXECDIR, however this is only valid once installed. make check will currently either fail or run pre-existing versions. This patch adds a way to override that location by setting the env var WESTON_BUILD_DIR - which is then set by the test env script so make check will test the versions in the build directory regardless of whether they're installed or not. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-19cairo-util: Draw solid titlebar for frames with only buttonsBoyan Ding3-5/+10
Previously geometry was changed to leave space for titlebar if a frame has only buttons but no title. This patch fixes theme_render_frame to avoid transparent titlebar. Signed-off-by: Boyan Ding <stu_dby@126.com>
2014-07-05cairo-util: Set geometry_dirty in frame_set_titleBoyan Ding1-0/+1
Title can decide the geometry of a frame because it may affect the existence of titlebar, so setting geometry_dirty in frame_set_title for potential change. Signed-off-by: Boyan Ding <stu_dby@126.com>
2014-07-05cairo-util: Fix geometry for frames with buttons but without titleBoyan Ding1-2/+2
There exist frames which have buttons without title such as a simple X application piped through xwayland which doesn't specify a title. We draw the title bar with buttons, but hide it under the window because geometry thinks a window needs titlebar only if it has title. This patch change the condition, making it titlebar is needed if a frame has title or has button(s), which makes more sense. Signed-off-by: Boyan Ding <stu_dby@126.com>
2014-04-30cairo-util: Don't show a resize cursor on edges when we're maximizedJasper St. Pierre1-3/+8
This is substantially confusing to users, namely me. krh: Edited to just set grip size to zero.
2014-04-30cairo-util: Kill a duplicate testJasper St. Pierre1-2/+2
If !(x < margin), then clearly margin <= x. No need to test for it again.
2014-04-07Make sure config.h is included before any system headersAndrew Wedgbury1-2/+2
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>
2014-02-06xdg-shell: Add set_margin requestJasper St. Pierre2-0/+11
This is used to figure out the size of "invisible" decorations, which we'll use to better know the visible extents of the surface, which we can use for constraining, titlebars, and more.
2014-02-01build: Move shared/Makefile.am into toplevel Makefile.amKristian Høgsberg1-34/+0
2014-02-01build: Move clients/Makefile.am into toplevel Makefile.amKristian Høgsberg1-1/+1
2014-01-19shared/frame: NULL check before attempting to derefU. Artie Eoff1-7/+6
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19shared/frame: fix potential memory leak in frame_createU. Artie Eoff1-18/+25
In frame_create, we need to destroy any frame buttons created in preceding calls to frame_button_create during the function execution if any of the successive calls to frame_button_create fail. This has minimal severity since most, if not all, cases in frame_button_create that result in a fail (i.e. NULL result) means a program is OOM and the program will have to exit/abort anyway. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-12-02os: use posix_fallocate in creating sharable buffersPekka Paalanen1-1/+18
If posix_fallocate is available, use it instead of ftruncate. Unlike ftruncate, when posix_fallocate succeeds, it guarantees that you cannot run out of disk space, when later writing to the mmap()'ed file. With posix_fallocate, if os_create_anonymous_file() succeeds, the program cannot get a SIGBUS later from accessing this file via mmap. If there is insufficient disk space, the function fails and errno is set to ENOSPC. This is useful on systems, that limit the available buffer space by having XDG_RUNTIME_DIR on a small tmpfs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-07cairo-util: Rework frame button handlingJason Ekstrand2-42/+122
This makes button handling more correct concerning drags. Also, frame_pointer_button returns the original button location in the case of a release. This makes filtering of button events much easier for users of the cair-util frame code. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-23window.c: Don't put titlebars on menu windowsKristian Høgsberg3-49/+74
2013-10-23window.c: Use frame code for drawing menusKristian Høgsberg2-8/+20
This gives us a nice frame and drop shadows for the menus.
2013-10-14Use cairo-util frame in tinytoolkitJason Ekstrand2-1/+97
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-13Add decoration frame support to cairo-utilJason Ekstrand3-0/+783
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-09-26config: Don't crash if we don't have a config fileAlexandru DAMIAN1-1/+1
Adding a check in weston_config_full_path so that we don't crash if we started without a config file. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-09-21compositor: Log the full path of the config file we're usingKristian Høgsberg2-36/+40
2013-09-21config-parser: Make weston_config_parse() tkae a file nameKristian Høgsberg2-10/+14
Take a basename of the config file to parse instead of an fd.
2013-09-21shared: Remove no longer used parse_config_file()Kristian Høgsberg2-133/+0
2013-08-12evdev-touchpad: Set some options using weston.iniArmin K2-0/+30
This patch adds 3 new options to weston.ini to allow the user to change default constant_accel_factor, min_accel_factor and max_accel_factor. If no options are set, it falls back using defaults as it did before. v2: create weston_config_section_get_double and use it instead of manualy converting string to double. v3: add default values in weston_config_get_double instead of using conditionals. v4: don't pass diagonal as pointer.
2013-08-08Add zalloc(size_t) allocator functionPeter Hutterer1-0/+42
Same as calloc(1, len).
2013-07-25shared: Add out-of-memory handling to theme_create()Kristian Høgsberg2-5/+29
2013-07-08tests: Move config-parser.test to tests/Quentin Glidic2-213/+0
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-07-03shared: Export configuration functionsQuentin Glidic1-0/+5
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2012-02-07shared: build fix for config-parser testPekka Paalanen1-0/+1
One more wayland-util.h not found issue, triggered by having libwayland installed to a custom prefix. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-06-05configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone6-4/+9
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-04shared: fix build of libshared-cairoPekka Paalanen1-0/+1
Another case of missing wayland-util.h, as we didn't pass any libwayland CFLAGS. This is triggerable on a system, where libwayland is installed in a custom prefix, and pixman, cairo, libpng, and webp are either not installed or are installed in the standard path. COMPOSITOR_CFLAGS contains more than just the libwayland CFLAGS, though. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-28config-parser: Add tests for expect behavuor on NULL configs and sectionsKristian Høgsberg1-0/+6
2013-05-28config-parser: Avoid null dereference when exiting. (case: weston starts ↵Mun Gwan-gyeong1-0/+3
without config file.) backtrace: (gdb) bt #0 0xb7704424 in __kernel_vsyscall () #1 0xb757ddde in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42 #2 <signal handler called> #3 weston_config_destroy (config=0x0) at config-parser.c:508 #4 0xb75cbc0e in x11_destroy (ec=0x93506b0) at compositor-x11.c:1473 #5 0x0804e0e9 in main (argc=1, argv=0xbffe5354) at compositor.c:3337
2013-05-28config-parser: Avoid null dereference when handling config-parser ( when ↵Mun Gwan-gyeong1-0/+3
weston starts without config file. ) backtrace: (gdb) bt #0 weston_config_next_section (config=0x0, section=0xbfb2b608, name=0xbfb2b618) at config-parser.c:485 #1 0xb75b1371 in x11_compositor_create (config=0x1, argv=0xbfb2ba44, argc=<optimized out>, use_pixman=0, no_input=0, fullscreen=0, display=0xb75b55f9) at compositor-x11.c:1582 #2 backend_init (display=0x8354490, argc=0xbfb2b9b0, argv=0xbfb2ba44, config=0x0) at compositor-x11.c:1674 #3 0x0804df7b in main (argc=1, argv=0xbfb2ba44) at compositor.c:3289
2013-05-26config-parser: Add section iterator APIKristian Høgsberg3-1/+41
The X backend needs to iterate through all outputs.
2013-05-26config-parser: Avoid null dereference when handling config-parserMun Gwan-gyeong1-0/+2
backtrace: (gdb) bt #0 weston_config_get_section (config=0x0, section=0x8062f31 "keyboard", key=0x0, value=0x0) at config-parser.c:265 #1 0x080535a1 in weston_compositor_init (ec=0x905b690, display=0x9056490, argc=0xbf8bd2f0, argv=0xbf8bd384, config_fd=-1) at compositor.c:2819 #2 0xb75d72bb in x11_compositor_create (config_fd=-1, argv=0xbf8bd384, argc=<optimized out>, use_pixman=0, no_input=0, fullscreen=0, display=0x9056490) at compositor-x11.c:1527 #3 backend_init (display=0x9056490, argc=0xbf8bd2f0, argv=0xbf8bd384, config_fd=-1) at compositor-x11.c:1746
2013-05-26config-parser-test: fix compile errorMun Gwan-gyeong1-1/+1
Add COMPOSITOR_CFLAGS to Makefile.am
2013-05-23Add new config parserKristian Høgsberg4-0/+491
The current config parser, parses the ini file and pulls out the values specified by the struct config_section passed to parse_config_file() and then throw the rest away. This means that every place we want to get info out of the ini file, we have to parse the whole thing again. It's not a big overhead, but it's also not a convenient API. This patch adds a parser that parses the ini file to a data structure and puts that in weston_compositor->config along with API to query comfig keys from the data structure. The old parser is still available, but we'll transition to the new approach over the next few commits.
2013-05-14config-parser: Honor XDG_CONFIG_DIRSOssama Othman2-33/+69
This set of changes adds support for searching for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config. This allows packages to install custom config files in /etc/xdg/weston, for example, thus allowing them to avoid dealing with home directories. To avoid a TOCTOU race the config file is actually open()ed during the search. Its file descriptor is returned and stored in the compositor for later use when performing subsequent config file parses. Signed-off-by: Ossama Othman <ossama.othman@intel.com>
2013-04-03Fix compiler warningsArmin K1-0/+1
This prevents compiler warnings when using libpng 1.6 and GCC 4.8
2013-03-28sdk: be C++ friendlyGiulio Camuffo2-0/+16
This renames the weston_surface's private member to configure_private and externs "C" the headers of the SDK.
2013-02-20Pass argc pointer to parse_options()Kristian Høgsberg2-3/+4
This lets us keep argc up to date as the backend picks out arguments from the argv array.
2013-01-28matrix: track transform typeVasily Khoruzhick2-3/+30
Introduce several matrix transform types and track type for matrix. Could be usefull for activating some fastpath that depends on some transform type. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2013-01-28Add new shared/image-loader.h to separate include dependenciesKristian Høgsberg5-6/+35
Before, cairo-util.h would combine pixman and cairo includes. X11 and Wayland compositors uses this to load an image as a pixman_image_t but are forced to include cairo headers. Clients use load_cairo_surface to load images as cairo_surface_t's, but are forced to include pixman.h. We move the load_image pixman prototype to its own header, so compositors can get at the pixman prototype without including cairo.h and clients can include the cairo based function without including pixman.h.
2012-12-07Link matrix.c into weston againKristian Høgsberg2-3/+6
We want to make sure that the matrix symbols are exported from weston and that modules get them from there. To do that, we pull matrix.[ch] out of libshared and back into weston. calibrator now also links to matrix.[ch] and we add a IN_WESTON define to enable the WL_EXPORT macro when compiled inside weston.
2012-12-06Move matrix.[ch] to sharedRob Bradford3-1/+316
This means it can be used for the calibration tool.
2012-11-30Fix build warnings from image_loaderPekka Paalanen2-1/+2
Fix the following build warnings, and the build failures due to the warning fixes: CC libshared_cairo_la-image-loader.lo image-loader.c:369:1: warning: no previous prototype for 'load_image' CC x11_backend_la-compositor-x11.lo compositor-x11.c: In function 'x11_output_set_icon': compositor-x11.c:396:2: warning: implicit declaration of function 'load_image' compositor-x11.c:396:8: warning: assignment makes pointer from integer without a cast CC wayland_backend_la-compositor-wayland.lo compositor-wayland.c: In function 'create_border': compositor-wayland.c:97:2: warning: implicit declaration of function 'load_image' compositor-wayland.c:97:8: warning: assignment makes pointer from integer without a cast Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>