Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
pijulius committed Jun 5, 2024
2 parents 3fbe856 + c2cb4df commit 400e517
Show file tree
Hide file tree
Showing 84 changed files with 855 additions and 737 deletions.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
# Workaround a NixOS limitation on sanitizers:
# See: https://github.com/NixOS/nixpkgs/issues/287763
export LD_LIBRARY_PATH+=":/run/opengl-driver/lib"
export UBSAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1"
export ASAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1"
'';
});
in rec {
Expand Down
4 changes: 2 additions & 2 deletions src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <uthash.h>

#include "compiler.h"
#include "list.h"
#include "log.h"
#include "utils.h"
#include "utils/list.h"
#include "utils/misc.h"

struct backend_plugins {
UT_hash_handle hh;
Expand Down
9 changes: 6 additions & 3 deletions src/atom.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>

#include <string.h>
#include <uthash.h>
#include <xcb/xcb.h>

#include "atom.h"
#include "cache.h"
#include "common.h"
#include "compiler.h"
#include "log.h"
#include "utils.h"
#include "utils/cache.h"
#include "utils/misc.h"

struct atom_entry {
struct cache_handle entry;
Expand Down Expand Up @@ -163,4 +166,4 @@ struct atom *init_mock_atoms(void) {
abort();
}

#endif
#endif
9 changes: 6 additions & 3 deletions src/atom.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>

#pragma once
#include <string.h>
#include <xcb/xcb.h>

#include "cache.h"
#include "meta.h"
#include "utils/meta.h"

// clang-format off
// Splitted into 2 lists because of the limitation of our macros
Expand Down Expand Up @@ -80,4 +83,4 @@ void destroy_atoms(struct atom *a);
/// secutive integers as atoms, starting from 1. Calling get_atom_name with atoms
/// previously seen will result in the string that was used to create the atom; if
/// the atom was never returned by get_atom, it will abort.
struct atom *init_mock_atoms(void);
struct atom *init_mock_atoms(void);
5 changes: 3 additions & 2 deletions src/backend/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

#include <picom/types.h>

#include "backend/backend.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "region.h"
#include "win.h"
#include "wm/win.h"
#include "x.h"

#include "backend.h"

static struct backend_info {
UT_hash_handle hh;
const char *name;
Expand Down
9 changes: 5 additions & 4 deletions src/backend/backend_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
#include <xcb/xcb_image.h>
#include <xcb/xcb_renderutil.h>

#include "backend/backend_common.h"
#include "common.h"
#include "config.h"
#include "kernel.h"
#include "log.h"
#include "utils.h"
#include "win.h"
#include "utils/kernel.h"
#include "utils/misc.h"
#include "wm/win.h"
#include "x.h"

#include "backend_common.h"

/**
* Generate a 1x1 <code>Picture</code> of a particular color.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/backend/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include <xcb/randr.h>
#include <xcb/xcb.h>

#include "backend/backend.h"
#include "backend/driver.h"
#include "common.h"
#include "compiler.h"
#include "log.h"

#include "driver.h"

/// Apply driver specified global workarounds. It's safe to call this multiple times.
void apply_driver_workarounds(struct session *ps, enum driver driver) {
if (driver & DRIVER_NVIDIA) {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <xcb/xcb.h>

#include "config.h"
#include "utils.h"
#include "utils/misc.h"

struct session;
struct backend_base;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/dummy/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "config.h"
#include "log.h"
#include "region.h"
#include "uthash_extra.h"
#include "utils.h"
#include "utils/misc.h"
#include "utils/uthash_extra.h"
#include "x.h"

struct dummy_image {
Expand Down
3 changes: 1 addition & 2 deletions src/backend/gl/blur.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include <locale.h>
#include <stdbool.h>

#include <backend/backend.h>
#include <backend/backend_common.h>
#include "backend/backend_common.h"

#include "gl_common.h"

Expand Down
7 changes: 4 additions & 3 deletions src/backend/gl/egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@

#include "backend/backend.h"
#include "backend/backend_common.h"
#include "backend/gl/egl.h"
#include "backend/gl/gl_common.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "picom.h"
#include "utils.h"
#include "utils/misc.h"
#include "x.h"

#include "egl.h"
#include "gl_common.h"

struct egl_data {
struct gl_data gl;
EGLDisplay display;
Expand Down
5 changes: 0 additions & 5 deletions src/backend/gl/egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
#include <xcb/render.h>
#include <xcb/xcb.h>

#include "compiler.h"
#include "log.h"
#include "utils.h"
#include "x.h"

struct eglext_info {
bool initialized;
bool has_EGL_MESA_query_driver;
Expand Down
6 changes: 3 additions & 3 deletions src/backend/gl/gl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

#include <picom/types.h>

#include "backend/backend_common.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "region.h"
#include "utils.h"
#include "utils/misc.h"

#include "backend/backend_common.h"
#include "backend/gl/gl_common.h"
#include "gl_common.h"

void gl_prepare(backend_t *base, const region_t *reg attr_unused) {
auto gd = (struct gl_data *)base;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/gl/gl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <xcb/xproto.h>

#include "backend/backend.h"
#include "backend/backend_common.h"

#include "log.h"
#include "region.h"

Expand Down
14 changes: 7 additions & 7 deletions src/backend/gl/glx.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
* See LICENSE-mit for more information.
*
*/

#include <X11/Xlib-xcb.h>
#include <limits.h>
#include <pixman.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include <X11/Xlib-xcb.h>
#include <pixman.h>
#include <uthash.h>
#include <xcb/composite.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>

#include "backend/backend.h"
#include "backend/backend_common.h"
#include "backend/gl/gl_common.h"
#include "backend/gl/glx.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "picom.h"
#include "utils.h"
#include "win.h"
#include "utils/misc.h"
#include "x.h"

#include "gl_common.h"
#include "glx.h"

struct _glx_data {
struct gl_data gl;
xcb_window_t target_win;
Expand Down
6 changes: 2 additions & 4 deletions src/backend/gl/glx.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#pragma once
#include <stdbool.h>

#include <X11/Xlib.h>
#include <epoxy/glx.h>
#include <stdbool.h>
#include <xcb/render.h>
#include <xcb/xcb.h>

#include "compiler.h"
#include "log.h"
#include "utils.h"
#include "x.h"

struct glx_fbconfig_info {
Expand Down
1 change: 1 addition & 0 deletions src/backend/gl/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
srcs += [ files('blur.c', 'egl.c', 'gl_common.c', 'glx.c', 'shaders.c') ]
7 changes: 2 additions & 5 deletions src/backend/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
srcs += [
files(
'dummy/dummy.c',
'xrender/xrender.c',
'backend.c',
'backend_common.c',
'driver.c',
),
]

subdir('xrender')
# enable opengl
if get_option('opengl')
srcs += [
files('gl/blur.c', 'gl/egl.c', 'gl/gl_common.c', 'gl/glx.c', 'gl/shaders.c'),
]
subdir('gl')
endif
1 change: 1 addition & 0 deletions src/backend/xrender/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
srcs += [ files('xrender.c') ]
5 changes: 2 additions & 3 deletions src/backend/xrender/xrender.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "kernel.h"
#include "log.h"
#include "picom.h"
#include "region.h"
#include "utils.h"
#include "win.h"
#include "utils/kernel.h"
#include "utils/misc.h"
#include "x.h"

struct xrender_image_data_inner {
Expand Down
20 changes: 6 additions & 14 deletions src/c2.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
// SPDX-License-Identifier: MIT

/*
* Compton - a compositor for X11
*
* Based on `xcompmgr` - Copyright (c) 2003, Keith Packard
*
* Copyright (c) 2011-2013, Christopher Jeffrey
* See LICENSE-mit for more information.
*
*/
// Copyright (c) 2011-2013, Christopher Jeffrey
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>

#include <assert.h>
#include <ctype.h>
Expand All @@ -34,11 +26,10 @@
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "string_utils.h"
#include "test.h"
#include "uthash_extra.h"
#include "utils.h"
#include "win.h"
#include "utils/str.h"
#include "utils/uthash_extra.h"
#include "wm/win.h"
#include "x.h"

#include "c2.h"
Expand Down Expand Up @@ -550,6 +541,7 @@ TEST_CASE(c2_parse) {

cond = c2_parse(NULL, "_NET_WM_STATE = '_NET_WM_STATE_HIDDEN'", NULL);
TEST_NOTEQUAL(cond, NULL);
c2_list_free(&cond, NULL);

cond = c2_parse(NULL, "1A:\n1111111111111ar1", NULL);
TEST_EQUAL(cond, NULL);
Expand Down
11 changes: 2 additions & 9 deletions src/c2.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Compton - a compositor for X11
*
* Based on `xcompmgr` - Copyright (c) 2003, Keith Packard
*
* Copyright (c) 2011-2013, Christopher Jeffrey
* See LICENSE-mit for more information.
*
*/
// Copyright (c) 2011-2013, Christopher Jeffrey
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>

#pragma once

Expand Down
Loading

0 comments on commit 400e517

Please sign in to comment.