Commit Graph

1599 Commits

Author SHA1 Message Date
Bernd Busse
e09679c7cf backend: glx: Fix texture access in max-brightness calculation
Correctly unpack the inner `gl_texture` from the backend image.

related: 2a60836a9b
2021-06-22 22:00:23 +02:00
yshui
2a23c24585 Merge pull request #638 from yshui/backend-image-api-change
Tweaking the image_op API interface.
2021-06-20 07:05:04 +01:00
Yuxuan Shui
710e5fd7a0 backend: remove image operation BAKE
It's not used.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:59:55 +01:00
Yuxuan Shui
48b7d7c27d Update coding style workflow
Alpine stopped packaging git-clang-format in newer versions.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:56:53 +01:00
Yuxuan Shui
2a60836a9b backend: split image_op into image_op and set_image_property
Currently there is some inconsistency in how image_op is implemented
across backends. The glx backend applies some of the image operations
lazily, and not always in the order the operations were made; while the
xrender backend applies the operations eagerly. This can lead to
different render result in some cases.

Instead of trying to preserving the order of operations, which would be
unnecessary, we re-model the API to better reflect the implementation.
We make it clear that setting the property doesn't change the image
data, and properties are only applied during composition and in a
specific order.

This makes sure the render result looks consistent across backends.
Should also improve the performance of the xrender backend, even if only
slightly.

Also distill out the property management code so they can be shared.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:49:38 +01:00
Yuxuan Shui
21dfe20794 backend: rename copy -> clone_image
This feels more appropriate as this operation doesn't necessarily copy
data.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-14 01:58:30 +01:00
Yuxuan Shui
d9c9742132 backend: xrender: implement read_pixel
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-09 01:51:33 +01:00
Yuxuan Shui
1ada765436 backend: xrender: make backend functions static
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-09 01:36:09 +01:00
yshui
be24c0d980 Merge pull request #631 from subnut/subnut/posix-sed
Improve POSIX-compatibility of picom-trans
2021-06-06 15:59:24 +01:00
Yuxuan Shui
86c54cc376 picom.sample.conf: fix comment about focus-exclude
Closes #594

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-04 20:01:34 +01:00
Yuxuan Shui
eaaef440a4 man: make it clear that --daemon can't be set from the config file
Closes #621

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-04 19:49:30 +01:00
yshui
27459907ca Merge pull request #591 from scrouthtv/patch-1
Minor fixes to the issue template
2021-06-04 19:13:52 +01:00
Subhaditya Nath
5394b2c2bc picom-trans: remove a no-longer-needed workaround 2021-05-31 12:32:15 +05:30
Subhaditya Nath
df1c6159fc picom-trans: Use POSIX-compatible getopts 2021-05-31 12:27:20 +05:30
Subhaditya Nath
7b4af3aef6 picom-trans: Use POSIX-compatible sed, grep
\b \? \+ \| are GNU extensions to sed

In BRE (Basic Regular Expressions) there is no \? \+ or \|
In ERE (Extended Regular Expressions) there is ? + and |
To specify sed to use ERE, specify the -E flag.

GNU grep does not distinguish between BRE and ERE, but other
implementations do. To make grep use ERE instead of BRE, specify
the -E flag.

The GNU extension \b has no equivalent in either BRE or ERE.
So, in line number 216, I used the whole initial expected output.

For quick reference (n/a means 'not available') -

 GNU BRE | POSIX BRE | POSIX ERE
 -------------------------------
    \(   |    \(     |    (
    \)   |    \)     |    )
    \?   |  \{0,1\}  |    ?  or {0,1}
    \+   |  \{1,\}   |    +  or {1,}
    \|   |    n/a    |    |
    \b   |    n/a    |   n/a
2021-05-31 12:14:19 +05:30
Yuxuan Shui
7ba87598c1 backend: gl_common: implement read_pixel
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-13 14:58:48 +01:00
Yuxuan Shui
6faafa95bf backend: add new API: read_pixel
Potential use: to read the border color of a window, so we could draw
rounded border when we round the corners of the window.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-13 14:53:57 +01:00
yshui
468d8a0879 Merge pull request #614 from yshui/rounded-border
Rounded border
2021-04-12 09:32:28 +01:00
Yuxuan Shui
b2f9f80a28 legacy glx: store tex_scr location for round corner shader
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-12 01:54:07 +01:00
bhagwan
d9bfd0192d legacy glx: extend the border into the corners when they are rounded
Authored-By: bhagwan <bhagwan@disroot.org>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-12 01:54:00 +01:00
yshui
9cb552ecd9 Merge pull request #598 from enigma9o7/next
Enable Menu Icon
2021-03-28 23:55:21 +01:00
Bodhi
8c26f2df46 Support Menu Icon 2021-03-03 00:01:55 -08:00
scrouthtv
d25a6e4831 Minor fixes to the issue template 2021-02-07 22:42:38 +01:00
yshui
3680d323f5 Merge pull request #579 from lschmelzeisen/next
Add packages needed for building on Fedora to README.
2021-01-24 20:59:20 +00:00
yshui
1d6a014e26 Merge pull request #581 from thiagokokada/fix-meson-flag-in-circleci
circleci: rename "-Dbuild_docs" -> "-Dwith_docs"
2021-01-24 20:58:52 +00:00
Thiago Kenji Okada
acadafb073 circleci: rename "-Dbuild_docs" -> "-Dwith_docs"
This was renamed in commit 3f2a671, but I think it was simply forgotten
in CI.
2021-01-06 00:08:21 -03:00
Lukas Schmelzeisen
3d4f9f925f Add packages needed for building on Fedora to README. 2021-01-04 22:52:43 +01:00
Yuxuan Shui
d974367a04 backend: xrender: remove root_pict from _xrender_data
It's unused in the backend.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:53:03 +00:00
Yuxuan Shui
f5fb2648fd x: remove more of session_t parameters
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:51:03 +00:00
Yuxuan Shui
d61fa6eb0c x: restrict the scope of arguments taken by x_get_prop*
They only need a xcb_connection_t, don't need to pass the whole
session_t.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:39:21 +00:00
Yuxuan Shui
e3d4ce6612 cache: add cache_set for testing
Also add documentation for the cache functions.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:25:34 +00:00
Yuxuan Shui
1df3360989 diagnostic: warn the user if they are using a software GL renderer
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-23 03:11:25 +00:00
Yuxuan Shui
b66e5fd422 win: sanitize _NET_FRAME_EXTENTS values
Shouldn't crash picom for window manager bugs.

Related: https://github.com/yshui/picom/issues/270#issuecomment-748210643

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-18 23:45:11 +00:00
Bernd Busse
cce531a5ed opengl: fix warning about unused variable 2020-12-17 23:19:53 +01:00
Bernd Busse
a335eed0b5 c2: Fix scope of predefined target in leaf-matching
Keeping pointers to variables with smaller scope is unsafe as the
compiler might choose to optimize them out.
2020-12-17 11:37:19 +01:00
yshui
2e2b1eeeb1 Update README.md 2020-12-17 00:25:57 +00:00
Yuxuan Shui
896c1a7702 render: restrict painting region of glx_round_corners_dst
Mistake during rebase.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-16 23:34:53 +00:00
Yuxuan Shui
06c58d0b8e render: avoid left shifting negative values
It's undefined behavior.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-16 22:55:33 +00:00
yshui
79f1d4e79d Merge pull request #558 from yshui/rounded-corners-legacy-glx2
Rounded corners for legacy glx backend
2020-12-16 21:22:15 +00:00
Yuxuan Shui
0f5f013b96 Rounded corners for legacy glx backend
Authored-by: bhagwan <bhagwan@disroot.org>
Authored-by: Samuel Hand <samuel.d.hand@gmail.com>
2020-12-16 18:10:36 +00:00
Bernd Busse
8802057ff3 Merge pull request #550 from tryone144/property-array-matching
c2: Perform matching against "all" property values with special index `[*]`
2020-12-15 22:52:45 +01:00
Bernd Busse
5989477b9f c2: Support matching against "all" property values with special index [*]
When matching against custom window properties or atoms perform the
matching against all available values using logical OR if the special index
`[*]` is specified. If no index is specified, we fall-back to the first
value.

This should help when an atom has multiple values and you only want to
check against any of these — e.g. hiding windows with state `hidden`:
`--opacity-rule "0:_NET_WM_STATE@[*]:32a *= 'HIDDEN'"` — without having to
explicitly specify each index separately or when the index is not known
in advance.

Updated the manpage with examples for hidden and sticky windows.
2020-12-15 22:32:07 +01:00
yshui
22948417b3 Merge pull request #568 from SebastienWae/nodisplay
Hide picom from application menus
2020-12-15 17:34:59 +00:00
yshui
8d2a06afb4 Update README.md
Fixes #566
2020-12-15 14:55:59 +00:00
Sebastien Waegeneire
84cc31450d set .desktop files to NoDisplay=true 2020-12-14 14:54:33 +01:00
Yuxuan Shui
af99101757 win: update screen after win_on_win_size_change
win_update_screen needs w->widthb/heightb, which is only updated in
win_on_win_size_change

Related: #554

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-05 23:01:16 +00:00
Yuxuan Shui
3c38b36f04 win: move win_update_screen from fill_win into win_process_update_flags
fill_win only sets the pending geometry (aka the shadow geometry) of the
window, we have to wait for it to propagate to the real geometry before
we can update the screen.

Related: #554

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-05 11:11:16 +00:00
Yuxuan Shui
ef9f09b68a core: don't add damage in handle_new_windows
Since commit 95a64acf5a, fill_win doesn't
set the window geometry anymore, so we can't use it in
handle_new_windows.

However, we don't need to add damage in handle_new_windows anyway,
damage will be added later when the MAPPED flag is handled.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-05 11:04:55 +00:00
Yuxuan Shui
80b35806f1 win: add debug logging to win_update_screen
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-05 11:03:55 +00:00
Yuxuan Shui
8be379db4d win: fix fading always skipped by unmap_win_start
Fading skip needs to be based on the original value of w->ever_damaged.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-04 04:22:48 +00:00