Hardening [Fri, 16 Aug 2013 22:30:31 +0000 (00:30 +0200)]
set RDP output enabled by default (stable 1.2)
This patch fixes a bug found by Marek Romanowic: the RDP peer output must
be enabled by default, or we have to unfocus/focus the RDP client window to
have disable/enable output messages sent (and finally receive updates).
Peng Wu [Mon, 19 Aug 2013 02:59:21 +0000 (10:59 +0800)]
Fixes CJK wide character display
By jumping two columns when wide character prints,
and draw wide background under wide character.
Rusty Lynch [Thu, 15 Aug 2013 16:10:08 +0000 (09:10 -0700)]
Add touch support for wl_shell_surface_move
Ander Conselvan de Oliveira [Tue, 16 Jul 2013 11:24:04 +0000 (14:24 +0300)]
nested: Fix skipping frames due to texture update without a context
Calls into cairo-gles may change the current context, so it was only by
chance that sometimes we had the proper one as current and updated the
correct texture in surface_attach().
In order to fix this, calling display_acquire_window_surface() before
binding the texture for setup is necessary. However this call has the
side effect of allocating a cairo surface for the window. At flush time,
the existence of this surface will cause an eglSwapBuffers(), even
if no rendering was done to it, leading to undefined contents on the
screen. This happens when the idle redraw task runs while there is a
pending frame callback.
Workaround this by moving the texture setup from surface_attach() to the
redraw handler, so that the cairo surface is only allocated when
redering is done.
Kristian Høgsberg [Thu, 15 Aug 2013 22:17:57 +0000 (15:17 -0700)]
nested: The wl_resouce is the buffer, not the wl_resource user data
Daniel Stone [Thu, 15 Aug 2013 00:10:24 +0000 (01:10 +0100)]
Add more missing config.h includes
config.h includes were missing in a few files, including input.c, the
lack of which caused the X11 backend to segfault instantly due to not
having an xkbcommon context.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg [Thu, 15 Aug 2013 21:28:25 +0000 (14:28 -0700)]
window: Use xzalloc() instead of silently failing to add output
Maksim Melnikau [Wed, 14 Aug 2013 19:33:10 +0000 (22:33 +0300)]
add [xwayland] path weston.ini option
It sets the path to the xserver to run.
Signed-off-by: Maksim Melnikau <maxposedon@gmail.com>
Kristian Høgsberg [Thu, 15 Aug 2013 21:20:53 +0000 (14:20 -0700)]
weston-info: Use xmalloc() in weston-info
Kristian Høgsberg [Thu, 15 Aug 2013 21:17:13 +0000 (14:17 -0700)]
window: Use xzalloc() instead of failing to add input device
Kristian Høgsberg [Thu, 15 Aug 2013 21:15:18 +0000 (14:15 -0700)]
window: Fix logic for looking up widget default cursor
We may deref a NULL pointer if there is no grab and no focus widget.
Kristian Høgsberg [Thu, 15 Aug 2013 19:26:42 +0000 (12:26 -0700)]
compositor: Handle OOM in weston_buffer_from_resource()
Handle NULL-return in call-sites as well.
Kristian Høgsberg [Thu, 15 Aug 2013 18:56:41 +0000 (11:56 -0700)]
window: Don't check for subcompositor in window_add_subsurface()
Client should check for subcompositor support up front. Now
window_add_surface() can never return NULL.
Kristian Høgsberg [Thu, 15 Aug 2013 18:54:03 +0000 (11:54 -0700)]
window: Add API to check for subcompositor, use in subsurface example
This way we can fail with a nice error message.
Kristian Høgsberg [Thu, 15 Aug 2013 18:40:30 +0000 (11:40 -0700)]
simple-touch: Handle OOM when allocating struct touch
Kristian Høgsberg [Thu, 15 Aug 2013 18:39:52 +0000 (11:39 -0700)]
simple-shm: Handle OOM when allocating struct display
Kristian Høgsberg [Thu, 15 Aug 2013 18:37:09 +0000 (11:37 -0700)]
keyboard: Don't use next_utf8_char() to go back where we came from
We go one utf8 char back and then one forward. Just remember the original
position instead, which also avoids a warning about potentially
dereferencing a NULL return value from next_utf8_char().
Armin K [Wed, 14 Aug 2013 01:13:53 +0000 (03:13 +0200)]
autotools: Add configure summary
Kristian Høgsberg [Wed, 14 Aug 2013 00:23:54 +0000 (17:23 -0700)]
terminal: Make utf-8 state machine assemble unicode code point value
Giulio Camuffo [Tue, 13 Aug 2013 21:10:14 +0000 (23:10 +0200)]
compositor: ref-count weston_surface instances
This allows a surface to live on after its resource has been
destroyed. The ref-count can be increased in a resource destroy signal
listener, to keep the surface around for a destroy animation, for example.
Kristian Høgsberg [Tue, 13 Aug 2013 21:55:39 +0000 (14:55 -0700)]
evdev: Ignore joystick devices
We don't handle them in any way now and having your steering wheel move
the cursor isn't useful. Applications can still open evdev devices and
access them directly like they already do.
Giulio Camuffo [Tue, 13 Aug 2013 09:42:02 +0000 (11:42 +0200)]
xwm: do not crash when activating a NULL surface
Armin K [Tue, 30 Jul 2013 23:41:03 +0000 (01:41 +0200)]
evdev-touchpad: Set some options using weston.ini
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.
Rob Bradford [Fri, 9 Aug 2013 10:30:38 +0000 (11:30 +0100)]
weston-launch: Only pass non-NULL value into setenv()
getenv() can return NULL is the key is not set, passing NULL into
setenv() is an error
Rolf Morel [Fri, 9 Aug 2013 14:32:17 +0000 (16:32 +0200)]
evdev: write EV_SYN input_event along with led events to device
Other clients of an evdev device need to have the events they receive
be separated, in moment in time, from other events by an EV_SYN/
SYN_REPORT. This is the responsibility of the client who writes events
into the stream.
Kristian Høgsberg [Tue, 13 Aug 2013 05:21:19 +0000 (22:21 -0700)]
nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display
Rob Bradford [Fri, 9 Aug 2013 15:52:46 +0000 (16:52 +0100)]
build: Allow more control over cairo use in the clients
Previously the configure script would silently disable the use of
accelerated cairo in the clients if cairo-gl could not be found (or
cairo-glesv2 if that was requested.) Conversely the use of cairo-gl
would be automatically enabled if it was found with no way to disable
that feature
This change adds --with-cairo which takes one of "image", "gl" or
"glesv2" (defaulting to "image"). If "gl" or "glesv2" is specified
cairo-egl is checked for as well as the specified renderer. If the check
fails then the configure process errors out.
Kristian Høgsberg [Tue, 13 Aug 2013 05:15:38 +0000 (22:15 -0700)]
screenshooter: Add missing newline and use program_invocation_short_name
Kristian Høgsberg [Tue, 13 Aug 2013 04:45:19 +0000 (21:45 -0700)]
screenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
This application doesn't use toytoolkit, so don't link to it. We have to
add a copy of xmalloc, to link without toytoolkit.
Giulio Camuffo [Sat, 10 Aug 2013 12:41:04 +0000 (14:41 +0200)]
Install shared/zalloc.h
Plugins need to have it available, as it is included in compositor.h.
https://bugs.freedesktop.org/show_bug.cgi?id=67948
Adrian Negreanu [Mon, 12 Aug 2013 13:30:11 +0000 (16:30 +0300)]
fix compile error when EGL_BUFFER_AGE_EXT is missing
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Adrian Negreanu [Mon, 12 Aug 2013 07:07:59 +0000 (10:07 +0300)]
remove dependency on EGL_KHR_surfaceless_context
cairo_egl_device_create(), which is called next,
already checks if EGL_KHR_surfaceless_context is
available. If not, it fallbacks to pbuffer.
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Rob Bradford [Mon, 22 Jul 2013 16:31:38 +0000 (17:31 +0100)]
input: For serial generation get the display from the compositor
This removes the use of wl_client_get_display() where the client is
derived from the focussed resource. This starts the removal of the
assumption of a single resource on a client that would be notified about
events on the focussed surface.
Rusty Lynch [Fri, 9 Aug 2013 04:28:22 +0000 (21:28 -0700)]
desktop-shell: Add touch support to panel launcher icons
Rusty Lynch [Fri, 9 Aug 2013 04:24:19 +0000 (21:24 -0700)]
calibrator: Add touch support to calibrator
Rusty Lynch [Fri, 9 Aug 2013 04:22:40 +0000 (21:22 -0700)]
smoke: Add touch support to smoke example
Rusty Lynch [Fri, 9 Aug 2013 04:20:38 +0000 (21:20 -0700)]
window.c: Add touch handlers
This adds basic infrastructure for handling touch events in the toytoolkit.
Rusty Lynch [Fri, 9 Aug 2013 04:13:57 +0000 (21:13 -0700)]
input: Store touch position and time when we start an implicit touch grab
Rusty Lynch [Fri, 9 Aug 2013 04:08:17 +0000 (21:08 -0700)]
evdev: Use touch ID 0 when generating touch up event
device->mt.slot is uninitialized when we're not receiving the
evdev slot events. Always use ID 0 as we do when we generate the
touch down and motion events.
Adrian Negreanu [Sun, 28 Jul 2013 15:27:23 +0000 (18:27 +0300)]
compositor: Setup weston-launch sock in fbdev
weston_launcher_open() was failing with:
recvmsg: Socket operation on non-socket
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Peter Hutterer [Fri, 9 Aug 2013 01:08:27 +0000 (11:08 +1000)]
configure.ac: check for wayland scanner macro
Brian Lovin [Thu, 8 Aug 2013 23:12:55 +0000 (16:12 -0700)]
terminal.c: Check if fdopen() fails
If fdopen() fails we just close the fd and return, failing
the copy-and-paste.
Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
Peter Hutterer [Tue, 6 Aug 2013 02:10:09 +0000 (12:10 +1000)]
weston-launch: always drop privileges before execve
The current code works if pw->pw_shell is bash because:
"If the shell is started with the effective user (group) id not equal to
the real user (group) id, and the -p option is not supplied, these actions
are taken and the effective user id is set to the real user id."
Thus, for bash, weston's EUID == UID.
For zsh, the -p option "is enabled automatically on startup if the effective
user (group) ID is not equal to the real user (group) ID."
Thus, weston's EUID = 0, and if pw_shell is zsh, /run/user/$UID/wayland-0 is
created with euid root and not writeable by the user, causing all clients to
fail.
Fix this by always dropping privileges to the user.
Regression introduced in 636156d.
Peter Hutterer [Wed, 7 Aug 2013 01:04:49 +0000 (11:04 +1000)]
evdev: log when a device is used as touchpad
Peter Hutterer [Wed, 7 Aug 2013 01:04:48 +0000 (11:04 +1000)]
evdev: call evdev_device_destroy on failure
Avoid keeping keeping what needs to be freed in sync in multiple places,
make evdev_device_destroy do the right thing instead.
Peter Hutterer [Wed, 7 Aug 2013 01:04:47 +0000 (11:04 +1000)]
evdev: plug a potential memleak
For touchpads, device->dispatch is set up when exiting
evdev_handle_device() and a potential source for a memleak.
This can't actually happen at the moment, as evdev_handle_device() won't
fail for touchpads after setting up the dispatch but prevent this from
happening in the future.
Peter Hutterer [Wed, 7 Aug 2013 01:04:46 +0000 (11:04 +1000)]
evdev: get the current slot value from the absinfo struct or mtdev
If touches are already present on the device, absinfo has the currently
active touch slot. There's a race condition where the slot may change before
we enable the fd and we thus miss out on the ABS_MT_SLOT event. It's still
slightly more correct than assuming whatever comes next is slot 0.
Peter Hutterer [Wed, 7 Aug 2013 01:04:45 +0000 (11:04 +1000)]
evdev: only use mtdev for Protocol A devices
For Protocol B devices, mtdev merely routes the events and is not needed.
For Protocol A devices, mtdev is needed, so fail for those devices now if we
mtdev fails.
Peter Hutterer [Wed, 7 Aug 2013 01:04:42 +0000 (11:04 +1000)]
evdev: add comment why we're ignoring key value 2
Peter Hutterer [Wed, 7 Aug 2013 01:04:41 +0000 (11:04 +1000)]
evdev: prevent unterminated device name
The kernel copies up to sizeof(devname) bytes but doesn't null-terminate the
string if the device name exceeds the size of the supplied buffer.
Peter Hutterer [Thu, 8 Aug 2013 07:13:47 +0000 (17:13 +1000)]
clients: fix an error message
_GNU_SOURCE is always true as of
c228e23b055f54d29f2df, so
program_invocation_short_name is available.
Peter Hutterer [Thu, 8 Aug 2013 07:13:46 +0000 (17:13 +1000)]
tty: fix typo in error message
Peter Hutterer [Thu, 8 Aug 2013 02:03:08 +0000 (12:03 +1000)]
evdev: check for ABS_MT_POSITION_X/Y to determine mt devices
mtdev as currently used in weston is a noop. mtdev's purpose is to convert
Protocol A devices (without ABS_MT_SLOT) to Protocol B devices (slots).
For Protocol B devices mtdev merely routes the events, so checking for
slots and then using mtdev based on that adds no functionality.
Check for ABS_MT_POSITION_X/Y instead and use that to categorise a device
as MT device. mtdev will provide us with a slotted protocol for all devices.
https://bugs.freedesktop.org/show_bug.cgi?id=54428
Peter Hutterer [Thu, 8 Aug 2013 01:57:05 +0000 (11:57 +1000)]
malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 8 Aug 2013 01:57:04 +0000 (11:57 +1000)]
Add zalloc(size_t) allocator function
Same as calloc(1, len).
Armin K [Wed, 7 Aug 2013 15:45:23 +0000 (17:45 +0200)]
cms-colord: Don't redefine _GNU_SOURCE
warning: "_GNU_SOURCE" redefined [enabled by default]
See commit
c228e23b
Brian Lovin [Wed, 7 Aug 2013 22:34:59 +0000 (15:34 -0700)]
clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.
Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
Kristian Høgsberg [Wed, 7 Aug 2013 19:11:27 +0000 (12:11 -0700)]
gl-renderer: Only check for subimage when we have extension at compile time
If weston is compiled against a gl2ext.h that doesn't have the subimage
extension, but then run against a gles2 library that does provide it,
we end up disabling the glTexImage2D falback without having the subimage
code paths compiled in.
Kristian Høgsberg [Wed, 7 Aug 2013 19:05:08 +0000 (12:05 -0700)]
Add workaround for broken GL_EXT_unpack_subimage tokens
Earlier versions of gl2ext.h defined the GL_EXT_unpack_subimage tokens
without the _EXT suffix. That's been fixed and we're using the _EXT
tokens now, but just in case we're using an older, broken header, define
the _EXT tokens manually.
Kristian Høgsberg [Wed, 7 Aug 2013 18:59:54 +0000 (11:59 -0700)]
gl-renderer.c: Cast wl_resource to void * to avoid warning
The extension has been updated to take a wl_resource * now, but to avoid
warnings when compiling against older versions, just cast to void *.
Kristian Høgsberg [Wed, 7 Aug 2013 16:55:07 +0000 (09:55 -0700)]
gl-renderer: Test for GL_EXT_unpack_subimage not GL_UNPACK_ROW_LENGTH
It is defined by the mesa #include, which is just a copy of the official
Khronos header. It's just defined in a different section than the
extension tokens. In the mean time, the extension tokens were renamed
to add a _EXT suffix (eg GL_UNPACK_ROW_LENGTH -> GL_UNPACK_ROW_LENGTH_EXT)
and we silently failed to used the subimage extension.
Kristian Høgsberg [Wed, 7 Aug 2013 16:50:12 +0000 (09:50 -0700)]
nested: Update to use weston-nested-client binary name
Kristian Høgsberg [Wed, 7 Aug 2013 02:27:04 +0000 (19:27 -0700)]
Use #define WL_HIDE_DEPRECATED to avoid deprecated warnings for wl_buffer
Stefan Schmidt [Mon, 5 Aug 2013 12:50:50 +0000 (13:50 +0100)]
clients: Fix typo in simple-touch and simple-shm.
listenter -> listener. Better fix it now before it spreads further.
Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Bryce Harrington [Tue, 6 Aug 2013 00:37:20 +0000 (17:37 -0700)]
Drop extraneous duplicate header includes
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Tomeu Vizoso [Tue, 6 Aug 2013 18:05:57 +0000 (20:05 +0200)]
rpi: Add support for SHM buffers in RGB565 format
Tomeu Vizoso [Tue, 6 Aug 2013 18:05:56 +0000 (20:05 +0200)]
pixman-renderer: Add support for SHM buffers in RGB565 format
Tomeu Vizoso [Tue, 6 Aug 2013 18:05:55 +0000 (20:05 +0200)]
gl-renderer: Add support for SHM buffers in RGB565 format
Tomeu Vizoso [Tue, 6 Aug 2013 18:05:54 +0000 (20:05 +0200)]
window: Allow hinting of a preference for RGB565 when creating a window
And check if the renderer supports the RGB565 format for wl_shm buffers
before creating the cairo surface and requesting the buffer.
It can save quite some memory with big surfaces such as desktop
backgrounds.
Kristian Høgsberg [Tue, 6 Aug 2013 23:46:25 +0000 (16:46 -0700)]
compositor: Check wl_resource_create() return value
This fixes a number of call-sites to properly check for NULL and return
the no memory event when allocation fail.
Kristian Høgsberg [Tue, 6 Aug 2013 17:31:12 +0000 (10:31 -0700)]
data-device.c: Handle failure to allocate offer in weston_drag_set_focus
If we fail to allocate and send the offer, don't send the drag enter and
don't set the drag focus so we don't send motion events or leave.
Kristian Høgsberg [Tue, 6 Aug 2013 17:24:04 +0000 (10:24 -0700)]
data-device.c: Handle OOM in weston_data_source_send_offer()
If we fail to allocate the resource, clean up and return NULL.
Rob Bradford [Fri, 26 Jul 2013 15:29:45 +0000 (16:29 +0100)]
desktop-shell: Refactor launcher configuration reading to avoid leaking
Rob Bradford [Fri, 26 Jul 2013 15:29:44 +0000 (16:29 +0100)]
compositor-x11: Don't leak the looked up name for skipped outputs
Rob Bradford [Fri, 26 Jul 2013 15:29:43 +0000 (16:29 +0100)]
window: Free the allocated display if we fail to setup libxkbcommon
Rob Bradford [Fri, 26 Jul 2013 15:29:42 +0000 (16:29 +0100)]
tablet-shell: Avoid leaking the path on failed icon loading
Rob Bradford [Fri, 26 Jul 2013 15:29:41 +0000 (16:29 +0100)]
image: Free filename saved into structure on error path
Rob Bradford [Fri, 26 Jul 2013 15:29:40 +0000 (16:29 +0100)]
compositor-drm: Use a format width parameter for the modeline sscanf
Rob Bradford [Fri, 26 Jul 2013 15:29:39 +0000 (16:29 +0100)]
compositor-fbdev: Close fd used for re-enabling if that fails
The device will be opened again in fbdev_output_create().
Rob Bradford [Fri, 26 Jul 2013 15:29:38 +0000 (16:29 +0100)]
compositor-fbdev: Avoid dereferencing a pointer in freed memory
fbdev_output_destroy will free the memory passed into in and since we
want to pass the device name into fbdev_output_create we need to save
this to an intermediate value
Rob Bradford [Fri, 26 Jul 2013 15:29:37 +0000 (16:29 +0100)]
tty: Correctly check if the opening of the file descriptor failed
Rob Bradford [Fri, 26 Jul 2013 15:29:36 +0000 (16:29 +0100)]
wcap-decode: Close file descriptor when destroying the decoder
Rob Bradford [Fri, 26 Jul 2013 15:29:35 +0000 (16:29 +0100)]
drm: close the drm file descriptor when the compositor is destroyed
Armin K [Tue, 30 Jul 2013 09:47:03 +0000 (11:47 +0200)]
autotools: Correctly prefix simple-egl client name
Eduardo Lima [Tue, 30 Jul 2013 17:43:41 +0000 (10:43 -0700)]
weston-launch: Fix signal mask typo
Kristian Høgsberg [Tue, 30 Jul 2013 16:45:04 +0000 (09:45 -0700)]
weston-launch: Unblock our signalfd signals before execing child
Giovanni Campagna ran into this with mutter.
Rob Bradford [Wed, 24 Jul 2013 15:57:33 +0000 (16:57 +0100)]
clipboard: remove the weston_seat destruction listener on destroy
Prior to freeing the memory in which the link node for the signal is
emedded we should remove the link node from the list to prevent the list
from being corrupted.
https://bugs.freedesktop.org/show_bug.cgi?id=67231
Rob Bradford [Wed, 24 Jul 2013 15:57:32 +0000 (16:57 +0100)]
text-backend: remove the weston_seat destruction listener on destroy
Prior to freeing the memory in which the link node for the signal is
emedded we should remove the link node from the list to prevent the list
from being corrupted.
https://bugs.freedesktop.org/show_bug.cgi?id=67231
Bryce W. Harrington [Tue, 23 Jul 2013 21:53:26 +0000 (21:53 +0000)]
screenshot: Drop extraneous 'is' to improve warning msg grammar
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Michael Fu [Tue, 23 Jul 2013 07:51:06 +0000 (15:51 +0800)]
Reset touch focus in unmap
Otherwise, there will be race condition of visiting invalid surface data.
Louis-Francis Ratté-Boulianne [Sat, 20 Jul 2013 04:16:45 +0000 (05:16 +0100)]
xwayland: Remove transform listener when destroying the wm
Fix a segfault occuring after the last X window was closed.
Armin K [Sun, 14 Jul 2013 15:26:23 +0000 (17:26 +0200)]
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
Armin K [Sun, 14 Jul 2013 15:26:22 +0000 (17:26 +0200)]
autotools: Rename demo clients
Prefix demo clients names with weston-, so they can
be installed if user desires.
Kristian Høgsberg [Fri, 26 Jul 2013 17:43:26 +0000 (10:43 -0700)]
evdev: Suport old-style single-touch touch screens
These screens send only BTN_TOUCH and ABS_X/Y.
Kristian Høgsberg [Fri, 26 Jul 2013 17:41:43 +0000 (10:41 -0700)]
evdev: Use temporary x and y coordinates when applying calibration
Don't overwrite device->abs.x halfway through the matrix multiplication.
Kristian Høgsberg [Fri, 26 Jul 2013 17:40:32 +0000 (10:40 -0700)]
evdev: Don't add output offset in evdev_process_absolute_motion()
We do that in weston_output_transform_coordinate() now.
Kristian Høgsberg [Thu, 25 Jul 2013 23:53:10 +0000 (16:53 -0700)]
window.c: Simplify window_create()
Kristian Høgsberg [Thu, 25 Jul 2013 23:44:45 +0000 (16:44 -0700)]
Use xmalloc in desktop-shell.c
Kristian Høgsberg [Thu, 25 Jul 2013 23:42:30 +0000 (16:42 -0700)]
compositor-x11: Use assert(0) instead of return NULL for non-reachable code
Kristian Høgsberg [Thu, 25 Jul 2013 23:25:15 +0000 (16:25 -0700)]
window.c: Use xmalloc for frame_create()