libdecor: update from source git repo (commit e87dcfda)

This brings the GTK plugin inside the master libdecor git repo.
This commit is contained in:
ManoloFLTK 2022-11-03 08:16:03 +01:00
parent 33f01ecb83
commit a5d2b5ed45
12 changed files with 87 additions and 17 deletions

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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>

View File

@ -509,7 +509,7 @@ if (OPTION_USE_WAYLAND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLIBDECOR_PLUGIN_DIR=${LIBDECOR_PLUGIN_DIR} ")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_SYSTEM_LIBDECOR")
else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/src -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\\\"\\\" ")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/src -I${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/src/plugins -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\\\"\\\" ")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SYSTEM_LIBDECOR=0 -DHAVE_MEMFD_CREATE -DHAVE_MKOSTEMP -DHAVE_POSIX_FALLOCATE")
endif (OPTION_USE_SYSTEM_LIBDECOR)
@ -529,7 +529,7 @@ if (OPTION_USE_WAYLAND)
if (NOT OPTION_USE_SYSTEM_LIBDECOR)
list (APPEND CFILES
../libdecor/build/fl_libdecor.c
../libdecor/src/plugins/cairo/libdecor-cairo-blur.c
../libdecor/src/plugins/common/libdecor-cairo-blur.c
)
endif (NOT OPTION_USE_SYSTEM_LIBDECOR)
endif (OPTION_USE_WAYLAND)