while we're at it we haven't needed the 'valid' checks for awhile
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
4061112460
commit
f3cb2fe15a
2 changed files with 21 additions and 34 deletions
|
|
@ -381,7 +381,6 @@ struct _MwLLWayland {
|
||||||
struct zwp_relative_pointer_v1* relative_pointer;
|
struct zwp_relative_pointer_v1* relative_pointer;
|
||||||
struct zwp_locked_pointer_v1* locked_pointer;
|
struct zwp_locked_pointer_v1* locked_pointer;
|
||||||
MwBool pointer_constrained;
|
MwBool pointer_constrained;
|
||||||
MwBool valid;
|
|
||||||
|
|
||||||
#ifdef USE_DBUS
|
#ifdef USE_DBUS
|
||||||
MwLLDBusContext dbus;
|
MwLLDBusContext dbus;
|
||||||
|
|
|
||||||
|
|
@ -951,7 +951,6 @@ static void widget_setup(MwLL r, MwLL parent, int x, int y, int width, int heigh
|
||||||
r->wayland.x = x;
|
r->wayland.x = x;
|
||||||
r->wayland.y = y;
|
r->wayland.y = y;
|
||||||
r->wayland.parent = parent;
|
r->wayland.parent = parent;
|
||||||
r->wayland.valid = MwTRUE;
|
|
||||||
|
|
||||||
if(ty == MwLL_WAYLAND_UNKNOWN) {
|
if(ty == MwLL_WAYLAND_UNKNOWN) {
|
||||||
if(parent == NULL) {
|
if(parent == NULL) {
|
||||||
|
|
@ -1152,33 +1151,29 @@ static void MwLLDestroyImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(handle->wayland.valid) {
|
if(handle->wayland.cursor.setup) {
|
||||||
if(handle->wayland.cursor.setup) {
|
MwLLWaylandBufferDestroy(&handle->wayland.cursor);
|
||||||
MwLLWaylandBufferDestroy(&handle->wayland.cursor);
|
wl_surface_destroy(handle->wayland.cursor.surface);
|
||||||
wl_surface_destroy(handle->wayland.cursor.surface);
|
}
|
||||||
}
|
wl_region_destroy(handle->wayland.region);
|
||||||
wl_region_destroy(handle->wayland.region);
|
wl_region_destroy(handle->wayland.o_region);
|
||||||
wl_region_destroy(handle->wayland.o_region);
|
|
||||||
|
|
||||||
/* clipboard sources are released with their managers in destroy_widget */
|
/* clipboard sources are released with their managers in destroy_widget */
|
||||||
if(handle->wayland.icon != NULL) {
|
if(handle->wayland.icon != NULL) {
|
||||||
if(handle->wayland.icon->setup) {
|
if(handle->wayland.icon->setup) {
|
||||||
MwLLWaylandBufferDestroy(handle->wayland.icon);
|
MwLLWaylandBufferDestroy(handle->wayland.icon);
|
||||||
wl_surface_destroy(handle->wayland.icon->surface);
|
wl_surface_destroy(handle->wayland.icon->surface);
|
||||||
}
|
|
||||||
free(handle->wayland.icon);
|
|
||||||
}
|
}
|
||||||
|
free(handle->wayland.icon);
|
||||||
|
}
|
||||||
|
|
||||||
destroy_widget(handle);
|
destroy_widget(handle);
|
||||||
|
|
||||||
/* Only parentless handles connect (children borrow the parent's display), and children are
|
/* Only parentless handles connect (children borrow the parent's display), and children are
|
||||||
* always freed before their parent, so nothing else is using it by now. */
|
* always freed before their parent, so nothing else is using it by now. */
|
||||||
if(!handle->wayland.parent && handle->wayland.display) {
|
if(!handle->wayland.parent && handle->wayland.display) {
|
||||||
wl_display_disconnect(handle->wayland.display);
|
wl_display_disconnect(handle->wayland.display);
|
||||||
handle->wayland.display = NULL;
|
handle->wayland.display = NULL;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
printf("widget invalid\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handle->wayland.icon_pixmap) MwLLDestroyPixmap(handle->wayland.icon_pixmap);
|
if(handle->wayland.icon_pixmap) MwLLDestroyPixmap(handle->wayland.icon_pixmap);
|
||||||
|
|
@ -1198,13 +1193,6 @@ static void MwLLDestroyImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
||||||
if(!handle->wayland.valid) {
|
|
||||||
*x = 0;
|
|
||||||
*y = 0;
|
|
||||||
*w = 1;
|
|
||||||
*h = 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*x = handle->wayland.x;
|
*x = handle->wayland.x;
|
||||||
*y = handle->wayland.y;
|
*y = handle->wayland.y;
|
||||||
*w = handle->wayland.ww;
|
*w = handle->wayland.ww;
|
||||||
|
|
@ -1687,8 +1675,8 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||||
/* RGBA -> BGRA, one pixel (4 bytes) at a time. The icon buffer is line x line, so rows
|
/* RGBA -> BGRA, one pixel (4 bytes) at a time. The icon buffer is line x line, so rows
|
||||||
* have to be placed with its stride rather than the pixmap's. */
|
* have to be placed with its stride rather than the pixmap's. */
|
||||||
for(; i < size; i += 4) {
|
for(; i < size; i += 4) {
|
||||||
int x = (i / 4) % pixmap->common.width;
|
int x = (i / 4) % pixmap->common.width;
|
||||||
int y = (i / 4) / pixmap->common.width;
|
int y = (i / 4) / pixmap->common.width;
|
||||||
unsigned char* dst = &handle->wayland.icon->buf_back[(y * line + x) * 4];
|
unsigned char* dst = &handle->wayland.icon->buf_back[(y * line + x) * 4];
|
||||||
|
|
||||||
dst[0] = pixmap->common.raw[i + 2];
|
dst[0] = pixmap->common.raw[i + 2];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue