mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
wayland: Assortment of fixes noticed during code review.
Rearranging order of the code, freeing some memory, writing a note that additional work is required, returning a value through pointer passed as argument, etc.
This commit is contained in:
parent
80cc4121ae
commit
36eefc981e
3 changed files with 11 additions and 3 deletions
|
@ -72,10 +72,10 @@
|
|||
# endif /* USE_GLITZ */
|
||||
#elif BUILD_SERVER == SERVER_wayland
|
||||
# include "wayland/WaylandServer.h"
|
||||
# define _CAIRO_GSTATE_CLASSNAME CairoGState
|
||||
# include "cairo/CairoGState.h"
|
||||
# define _CAIRO_SURFACE_CLASSNAME WaylandCairoSurface
|
||||
# include "cairo/WaylandCairoSurface.h"
|
||||
# define _CAIRO_GSTATE_CLASSNAME CairoGState
|
||||
# define _CAIRO_SURFACE_CLASSNAME WaylandCairoSurface
|
||||
#else
|
||||
# error Invalid server for Cairo backend : non implemented
|
||||
#endif /* BUILD_SERVER */
|
||||
|
|
|
@ -121,6 +121,10 @@ create_shm_buffer(struct window *window)
|
|||
{
|
||||
struct window *window = (struct window*) gsDevice;
|
||||
NSDebugLog(@"WaylandCairoSurface: dealloc win=%d", window->window_id);
|
||||
|
||||
// FIXME: This is leaking memory. We need to implement counterpart to
|
||||
// create_shm_buffer.
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -162,6 +166,7 @@ create_shm_buffer(struct window *window)
|
|||
|
||||
cairo_t *cr = cairo_create(cairo_surface);
|
||||
if (width != window->width && 0) {
|
||||
// FIXME: remove this dead fake-drawing branch.
|
||||
NSDebugLog(@"fake drawing");
|
||||
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
|
||||
|
||||
|
|
|
@ -954,6 +954,7 @@ int NSToWayland(struct window *window, int ns_y)
|
|||
window->surface = wl_compositor_create_surface(wlconfig->compositor);
|
||||
if (!window->surface) {
|
||||
NSDebugLog(@"can't create wayland surface");
|
||||
free(window);
|
||||
return 0;
|
||||
}
|
||||
wl_surface_set_user_data(window->surface, window);
|
||||
|
@ -1405,7 +1406,9 @@ int NSToWayland(struct window *window, int ns_y)
|
|||
if (window) {
|
||||
x += window->pos_x;
|
||||
y += window->pos_y;
|
||||
win = &window->window_id;
|
||||
if (win) {
|
||||
*win = &window->window_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue