Commit Graph

738 Commits

Author SHA1 Message Date
Yuxuan Shui 4f4201976d Fix signedness of x properties
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-11-01 11:12:46 +00:00
Yuxuan Shui 32e0b45255 Sanitize opacity data get from window props
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-31 23:18:10 +00:00
Yuxuan Shui d7b5104fd4 Remove poll.h include 2018-10-30 22:18:10 +00:00
Yuxuan Shui c0d7f9d915 Add damage when restacking windows
Interesting this problem only surface when using GTK applications on
KDE. Maybe on other WMs there are some other events after window
restacking that triggers repaint of the window.

Fixes #28

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 17:16:56 +00:00
Yuxuan Shui a312dcb3da Remove a debug message
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 13:36:48 +00:00
Yuxuan Shui 06d879251b Make building the docs optional
Fixes #29

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-29 11:55:10 +00:00
Yuxuan Shui 50e2259404 Remove xrender-sync and xrender-sync-fence
This was a dubious "fix" for a Nvidia driver problem. The problem was
never fully understood, and the then developers took a shotgun approach
and implemented xsync fences as a fix. Which somehow fixed the problem.
Again, I don't see any indication that the developers understood why
this "fix" worked.

(for details, see chjj/compton#152 and chjj/compton#181)

The driver problem should have been fixed almost 5 years ago. So this
shouldn't be needed anymore. In addition the way compton uses xsync fences
is apparently wrong according to the xsync spec (fences are attached to
screen, but compton uses them as if they were attached to drawables).

So, I will try removing it and see if anyone will complain. If there are
real concrete reasons why fences are needed, it will be brought back.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:36:55 +00:00
Yuxuan Shui 5694e75932 Fix build when opengl is disabled, again
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-28 23:09:42 +00:00
Yuxuan Shui 309a4cec79 Make monitor_repaint an option
This is a potentially useful feature for debugging the xrender backend,
so make it a commandline option rather than an obscure compiler flag.

Also this is only usable with xrender, for glx there are better tools
for debugging.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 551d487836 Remove some unused parameters
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui f519ee53c1 Remove support of Xdbe
--dbe does not seem to have an effect on tearing, as noted in the old
manpage, and confirmed by my own testing.

So remove it, since it complicates the logic of painting.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 1f95c74a68 Move struct win to win.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 0686300013 Move some common functions to utils.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui e13bc7fc51 Move common types to types.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 3ffc0c77ed Replace get_alpha_pict with get_alpha_step
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-25 23:32:10 +01:00
Yuxuan Shui 16f202f4a0 Fix build when opengl is disabled 2018-10-25 23:31:57 +01:00
Yuxuan Shui df63cab39a Print messages about removed options
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-24 11:10:35 +01:00
Yuxuan Shui db700f9be1 Fix OOB when the number of screens change 2018-10-22 15:38:45 +01:00
Yuxuan Shui a47f112833 Update issue template 2018-10-22 01:27:17 +01:00
Yuxuan Shui e87dd2355c Update README 2018-10-21 01:18:24 +01:00
Yuxuan Shui 47a49ed6f9 Use predefined version when not building from git repo 2018-10-17 00:17:40 +01:00
Yuxuan Shui 0b866fb17f Hot fix: trail when moving windows around
Call win_on_factor_change when window is moved. This does some
duplicate work, but fix the problem for now.
2018-10-16 17:16:18 +01:00
Yuxuan Shui f84336a9b7 Set COMPTON_VERSION 2018-10-16 10:29:52 +01:00
Yuxuan Shui 93dd2d92fd Add -DNDEBUG flag for release build 2018-10-15 11:16:32 +01:00
Yuxuan Shui 46a6a391b6 Update README.md 2018-10-15 11:12:45 +01:00
Yuxuan Shui d8c0995eed Update building instructions in README.md 2018-10-15 00:47:24 +01:00
Yuxuan Shui 4094d8b9c4 Add initial meson build scripts 2018-10-15 00:38:21 +01:00
Yuxuan Shui aa2098eefd Move w->bounding_shape to local coordinates
This way we don't need to update the bounding region after window moves.

Also add some comments about the coordinate systems in compton.
Also change a few function that takes a `bool global` parameter to
always return region in local coordinates.
2018-10-13 01:24:52 +01:00
Yuxuan Shui 4f071ffc30 Fix infinite recursive calls
win_rounded_corners is called by win_updated_bounding_shape, so there is
no need for the former to call the later.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-12 23:37:02 +01:00
Yuxuan Shui bbb73fe64e Fix integer overflow
`x + wid` will convert x to unsigned first, if x < 0, integer overflow
could occur.
2018-10-12 23:17:12 +01:00
Yuxuan Shui de6e2f5792 Merge branch 'less-xlib' into next
Closes #14
2018-10-10 10:55:21 +01:00
Uli Schlachter 9bb3327549 Die when the X11 connection breaks
With libX11, the library calls an I/O error handler if the connection to
the server breaks. The default I/O error handler prints an error message
and calls exit(). This can be seen when running a "pre-xcb" compton
against Xephyr and then closing the Xephyr window:

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
      after 241 requests (241 known processed) with 0 events remaining.

The current compton would just continue running. After this commit, it
instead exits with this message:

handle_queued_x_events(): X11 server connection broke (error 1)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:54:05 +01:00
Uli Schlachter 1c1adc96c8 Change event masks to XCB defines
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:54:05 +01:00
Uli Schlachter 37ef9c5b8a Add the xcb_connection_t to session_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-10 10:54:00 +01:00
Uli Schlachter 54807342f4 Convert XQueryTree to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:50:00 +01:00
Uli Schlachter 6c6156932f Convert find_client_win() to XCB
This function was the only caller of wid_get_children() which called
XQueryTree().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:50:00 +01:00
Uli Schlachter b2bfbcdfb0 Convert XGetAtomName to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-10 10:49:52 +01:00
Uli Schlachter ca148c8f15 Fix printf format with DEBUG_EVENTS
Xlib uses unsigned long for XIDs, but xcb always uses uint32_t. Thus,
this needs the format string for uint32_t now.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:46:39 +01:00
Uli Schlachter 7e71f46401 Convert XInternAtom to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-10 10:46:34 +01:00
Uli Schlachter 2da0ecdf66 Convert XSelectInput() to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-10-10 10:42:12 +01:00
Uli Schlachter 1b1b3456bc Convert XGetSelectionOwner to XCB
This also fixes a memory leak: buf was not freed if another composite
manager was already running.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter 2dc90e7d4d Convert XGetInputFocus to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter 8db6473d32 Convert property management to XCB
I removed the error checking in compton.c because it was dead code.
XChangeProperty() always returns 1.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter a192bfb130 Replace XSetSelectionOwner with XCB
Note that the argument order is different between Xlib and XCB.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter 0cae42faaa Replace XDestroyWindow with xcb_destroy_window
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter e30ff25dd3 Replace XClearArea with xcb_clear_area
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter 28e9488e25 XCBify XCreateGC and XFreeGC
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter b86190452c XCBify X{Ung,G}abServer
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Uli Schlachter 3c5d7555a4 XCBify X{Unm,M}apWindow
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-10-10 10:41:40 +01:00
Yuxuan Shui 6a8df0ada7 Fix a leak of XFIXES regions 2018-10-09 22:24:00 +01:00