summaryrefslogtreecommitdiff
path: root/libdecor
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-03 08:16:03 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-03 08:16:49 +0100
commita5d2b5ed451ca8414bc3a82288fbbf63fcc97070 (patch)
treedfe6366a3cd909c79d36c7cf251dec832eba635b /libdecor
parent33f01ecb836f9bd70447fcd7ab0f7eda27d224db (diff)
libdecor: update from source git repo (commit e87dcfda)
This brings the GTK plugin inside the master libdecor git repo.
Diffstat (limited to 'libdecor')
-rw-r--r--libdecor/build/Makefile6
-rw-r--r--libdecor/demo/demo.c14
-rw-r--r--libdecor/demo/egl.c1
-rw-r--r--libdecor/src/cursor-settings.c25
-rw-r--r--libdecor/src/cursor-settings.h25
-rw-r--r--libdecor/src/libdecor.h1
-rw-r--r--libdecor/src/os-compatibility.c21
-rw-r--r--libdecor/src/plugins/cairo/libdecor-cairo.c3
-rw-r--r--libdecor/src/plugins/common/libdecor-cairo-blur.c (renamed from libdecor/src/plugins/cairo/libdecor-cairo-blur.c)0
-rw-r--r--libdecor/src/plugins/common/libdecor-cairo-blur.h (renamed from libdecor/src/plugins/cairo/libdecor-cairo-blur.h)0
-rw-r--r--libdecor/src/plugins/gtk/libdecor-gtk.c4
11 files changed, 85 insertions, 15 deletions
diff --git a/libdecor/build/Makefile b/libdecor/build/Makefile
index b391e6bc6..8d7b8b673 100644
--- a/libdecor/build/Makefile
+++ b/libdecor/build/Makefile
@@ -31,7 +31,7 @@ Linux_CFLAGS =
FreeBSD_CFLAGS = -I/usr/local/include
EXTRA_DECOR = ${${UNAME}_CFLAGS}
-CFLAGS_DECOR = -I. -I../.. -I../../src -I../src $(EXTRA_DECOR) -fPIC -D_GNU_SOURCE \
+CFLAGS_DECOR = -I. -I../.. -I../../src -I../src -I../src/plugins $(EXTRA_DECOR) -fPIC -D_GNU_SOURCE \
-DUSE_SYSTEM_LIBDECOR=0 -DHAVE_MEMFD_CREATE -DHAVE_MKOSTEMP -DHAVE_POSIX_FALLOCATE
Linux_NOPIE = -no-pie
@@ -49,8 +49,8 @@ fl_libdecor.o : fl_libdecor.c ../src/libdecor.c ../../src/xdg-shell-protocol.c .
fl_libdecor-plugins.o : fl_libdecor-plugins.c ../src/plugins/cairo/libdecor-cairo.c
$(CC) $(CFLAGS) $(CFLAGS_DECOR) -c fl_libdecor-plugins.c -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\"\"
-libdecor-cairo-blur.o : ../src/plugins/cairo/libdecor-cairo-blur.c
- $(CC) $(CFLAGS_DECOR) -c ../src/plugins/cairo/libdecor-cairo-blur.c
+libdecor-cairo-blur.o : ../src/plugins/common/libdecor-cairo-blur.c
+ $(CC) $(CFLAGS_DECOR) -c ../src/plugins/common/libdecor-cairo-blur.c
os-compatibility.o : ../src/os-compatibility.c
$(CC) $(CFLAGS_DECOR) -c ../src/os-compatibility.c
diff --git a/libdecor/demo/demo.c b/libdecor/demo/demo.c
index ff285cc2f..26d955c18 100644
--- a/libdecor/demo/demo.c
+++ b/libdecor/demo/demo.c
@@ -2,6 +2,7 @@
* Copyright © 2011 Benjamin Franzke
* Copyright © 2010 Intel Corporation
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -1117,6 +1118,13 @@ handle_configure(struct libdecor_frame *frame,
enum libdecor_window_state window_state;
struct libdecor_state *state;
+ /* Update window state first for the correct calculations */
+ if (!libdecor_configuration_get_window_state(configuration,
+ &window_state))
+ window_state = LIBDECOR_WINDOW_STATE_NONE;
+
+ window->window_state = window_state;
+
if (!libdecor_configuration_get_content_size(configuration, frame,
&width, &height)) {
width = window->content_width;
@@ -1129,12 +1137,6 @@ handle_configure(struct libdecor_frame *frame,
window->configured_width = width;
window->configured_height = height;
- if (!libdecor_configuration_get_window_state(configuration,
- &window_state))
- window_state = LIBDECOR_WINDOW_STATE_NONE;
-
- window->window_state = window_state;
-
state = libdecor_state_new(width, height);
libdecor_frame_commit(frame, state, configuration);
libdecor_state_free(state);
diff --git a/libdecor/demo/egl.c b/libdecor/demo/egl.c
index 3d7331645..8963ea457 100644
--- a/libdecor/demo/egl.c
+++ b/libdecor/demo/egl.c
@@ -2,6 +2,7 @@
* Copyright © 2011 Benjamin Franzke
* Copyright © 2010 Intel Corporation
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
diff --git a/libdecor/src/cursor-settings.c b/libdecor/src/cursor-settings.c
index b94623fd6..225034cdd 100644
--- a/libdecor/src/cursor-settings.c
+++ b/libdecor/src/cursor-settings.c
@@ -1,3 +1,28 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
#include "cursor-settings.h"
#include <stdlib.h>
#include <string.h>
diff --git a/libdecor/src/cursor-settings.h b/libdecor/src/cursor-settings.h
index 700bb4f30..0cc1cb6bf 100644
--- a/libdecor/src/cursor-settings.h
+++ b/libdecor/src/cursor-settings.h
@@ -1,3 +1,28 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
#pragma once
#include <stdbool.h>
diff --git a/libdecor/src/libdecor.h b/libdecor/src/libdecor.h
index d3ccea181..078169771 100644
--- a/libdecor/src/libdecor.h
+++ b/libdecor/src/libdecor.h
@@ -1,6 +1,7 @@
/*
* Copyright © 2017-2018 Red Hat Inc.
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
diff --git a/libdecor/src/os-compatibility.c b/libdecor/src/os-compatibility.c
index 50beb79f8..8287da0e6 100644
--- a/libdecor/src/os-compatibility.c
+++ b/libdecor/src/os-compatibility.c
@@ -29,6 +29,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <signal.h>
#include <string.h>
#include <stdlib.h>
@@ -86,11 +87,27 @@ static int
os_resize_anonymous_file(int fd, off_t size)
{
#ifdef HAVE_POSIX_FALLOCATE
+ sigset_t mask;
+ sigset_t old_mask;
+
+ /* posix_fallocate() might be interrupted, so we need to check
+ * for EINTR and retry in that case.
+ * However, in the presence of an alarm, the interrupt may trigger
+ * repeatedly and prevent a large posix_fallocate() to ever complete
+ * successfully, so we need to first block SIGALRM to prevent
+ * this.
+ */
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGALRM);
+ sigprocmask(SIG_BLOCK, &mask, &old_mask);
/*
- * Filesystems that do support fallocate will return EINVAL or
+ * Filesystems that do not support fallocate will return EINVAL or
* EOPNOTSUPP. In this case we need to fall back to ftruncate
*/
- errno = posix_fallocate(fd, 0, size);
+ do {
+ errno = posix_fallocate(fd, 0, size);
+ } while (errno == EINTR);
+ sigprocmask(SIG_SETMASK, &old_mask, NULL);
if (errno == 0)
return 0;
else if (errno != EINVAL && errno != EOPNOTSUPP)
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo.c b/libdecor/src/plugins/cairo/libdecor-cairo.c
index 12af8aacb..0cc0ce0dd 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo.c
+++ b/libdecor/src/plugins/cairo/libdecor-cairo.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -44,7 +45,7 @@
#include <cairo/cairo.h>
#include <pango/pangocairo.h>
-#include "libdecor-cairo-blur.h"
+#include "common/libdecor-cairo-blur.h"
static const size_t SHADOW_MARGIN = 24; /* graspable part of the border */
static const size_t TITLE_HEIGHT = 24;
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo-blur.c b/libdecor/src/plugins/common/libdecor-cairo-blur.c
index 2cddc7a23..2cddc7a23 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo-blur.c
+++ b/libdecor/src/plugins/common/libdecor-cairo-blur.c
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo-blur.h b/libdecor/src/plugins/common/libdecor-cairo-blur.h
index d48e9dd3d..d48e9dd3d 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo-blur.h
+++ b/libdecor/src/plugins/common/libdecor-cairo-blur.h
diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c
index a2019d5af..448fdb855 100644
--- a/libdecor/src/plugins/gtk/libdecor-gtk.c
+++ b/libdecor/src/plugins/gtk/libdecor-gtk.c
@@ -42,9 +42,7 @@
#include <cairo/cairo.h>
-/* Note for FLTK: This header file changes location, while its content stays unchanged,
- between the master and gtk_cairo_single branches */
-#include "../cairo/libdecor-cairo-blur.h"
+#include "common/libdecor-cairo-blur.h"
#include <poll.h>
#include <gtk/gtk.h>