Uli Schlachter and Yuxuan Shui
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 and Yuxuan Shui
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 and Yuxuan Shui
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 and Yuxuan Shui
2dc90e7d4d
Convert XGetInputFocus to XCB
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-10 10:41:40 +01:00
Uli Schlachter and Yuxuan Shui
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 and Yuxuan Shui
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 and Yuxuan Shui
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 and Yuxuan Shui
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 and Yuxuan Shui
28e9488e25
XCBify XCreateGC and XFreeGC
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-10 10:41:40 +01:00
Uli Schlachter and Yuxuan Shui
b86190452c
XCBify X{Ung,G}abServer
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-10 10:41:40 +01:00
Uli Schlachter and Yuxuan Shui
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
Yuxuan Shui
7b755a3cf0
Fix typo in CONTRIBUTORS, move licenses around
...
Having a LICENSE file makes github happy
2018-10-03 22:24:12 +01:00
Yuxuan Shui
ee318582f5
Sort out license problems
...
IANAL, but I think I am allowed to add missing copyright notices for
someone else. And I did my best job using git history to figure out who
wrote which functions. So I hope everything is fine.
2018-10-03 22:14:51 +01:00
Yuxuan Shui
9e1422dc90
Fix parsing of shadow-exclude-reg
...
Closes #13
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-10-03 18:20:40 +01:00
Yuxuan Shui
f1872c4033
Allocation for xinerama_scr_regs used wrong size
...
Should be sizeof(region_t). Rebasing is hard :(
2018-10-03 16:19:48 +01:00
Yuxuan Shui
2a4fed50f4
Use libev for inputs and timeouts
...
Bugs:
* There seems to be a noticeable frame loss when window
is being opened/closed. But the same problem also exists
in master/next, so this is not a regression.
* Using --sw-opti and --benchmark at the same time causing
compton to draw more frequently than permitted by the
arguments. That is because the sleep interval calculation
is flawed. Not really a regression either.
Verified still working:
* Usual painting
* Fade
* Benchmark mode
* --sw-opti (with or without benchmark mode)
* DBus
* Unredir delay
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-10-03 01:05:32 +01:00
yshui and GitHub
e58de49d7a
Merge pull request #10 from psychon/remove-xfixes
...
Some more trivial Xlib -> XCB conversions
2018-10-02 21:38:28 +01:00
Yuxuan Shui
d917ec22a8
Fix a typo in conversion to xcb damage
2018-10-02 21:25:09 +01:00
Uli Schlachter
385ba2cdf6
Remove unused definition
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:56:47 +02:00
Uli Schlachter
cad786c025
Remove include of X11/Xutil.h
...
It doesn't seem to cause any problems. Perhaps its uses were already
converted to XCB?
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:54:20 +02:00
Uli Schlachter
bc7767e086
Replace Xlib atom constants with XCB ones
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:53:28 +02:00
Uli Schlachter
b2d947a19a
Remove include of Xfixes.h
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:51:37 +02:00
Uli Schlachter
91468c3622
Replace BadRegion with XCB_XFIXES_BAD_REGION
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:51:30 +02:00
Uli Schlachter
7c174cc3b1
Replace XserverRegion with xcb_xfixes_region_t
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-10-02 19:50:27 +02:00
Yuxuan Shui
cb4bab1cf6
Print deprecation warning for removed OpenGL options
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 21:07:29 +01:00
Yuxuan Shui
03f33ed45c
Move a couple X related functions to x.c
...
Also replace remaining Pixmap with xcb_pixmap_t
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 20:57:42 +01:00
Yuxuan Shui
ddab20176b
Fix building with ENABLE_XRESCHECK=1
2018-09-30 20:43:34 +01:00
Yuxuan Shui
18022181ee
Make sure to clear the rectangles
2018-09-30 20:41:30 +01:00
Yuxuan Shui
6a41bebfa5
Just clear shadow anyways
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 20:12:06 +01:00
Yuxuan Shui
97cd3421b0
Remove last bits of Xfixes
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
e0bc6f5f7c
Add helper macros for calling xcb function and wait for reply
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
ff27ca4072
Move xerror_common to x.c
...
Also rename it to x_print_error
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
915839c3d3
Convert XFixesCreateRegionFromWindow to use Shape directly
...
Fetch the rectangles directly use the Shape extension.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
82e63593ae
region.h: helper functions for converting rect types
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
a7d50ffdb2
Remove unused function rect_crop
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 15:54:12 +01:00
Yuxuan Shui
28a2cc62fa
Convert XfixesRegion to pixman region
...
Re-did the painting logic, and document it.
It is unclear to me what is the previous painting logic. But the current
one is basically this:
1. Go through all windows top to bottom, and put visible windows (not
unmapped, opacity > 0, etc) into a linked list, from bottom to top
2. Accumulate a region of ignore on each window, which is basically the
region of screen that is obscured by all the windows above current
one.
3. Paint all the visible windows from bottom to top. Subtract the region
of ignore from the painting region. If we need to paint shadow, we
subtract the body of the window from the shadow painting region too,
because we don't want shadow behind the window.
4. region of ignore is invalidated when window stack change, an
window on top moved or changed shape, when window changed between
opaque and transparent, etc.
Notes:
It is unclear whether all the different shapes of a window (extents,
noframe, border, bounding shape, etc) are calculated correctly or not.
It is unclear if window shape related events are handled correctly or
not. Need more testing.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 14:18:33 +01:00
Yuxuan Shui
56f7dd36f6
x: Add region related helper functions
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 14:18:33 +01:00
Yuxuan Shui
3f4c05720d
utils.h: Some utility functions and macros
...
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 14:18:33 +01:00
Yuxuan Shui
ab12467c3f
Change fade callback function parameter
...
Change `win *` to `win **`, because a window could be freed by the
callback, so we can set `*w` to NULL to communicate that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 14:18:33 +01:00
Yuxuan Shui
417744df14
Move opengl related function prototype to opengl.h
...
And aggregate some of the OPENGL ifdefs
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 14:18:01 +01:00
Yuxuan Shui
c01ad5bf04
Move OpenGL functions around
...
Also remove some debug function calls (there are better tools for opengl
debugging now). Also remove copysubbuffermesa
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 13:49:45 +01:00
Yuxuan Shui
90b6aa16ad
Remove ARGB as a window mode
...
Instead use win_has_alpha to check for alpha channel, window mode is
reserved for determine if the window is possibly transparent.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com >
2018-09-30 13:49:45 +01:00
Uli Schlachter
8848676540
Add a function that allocates a pixmap and checks success
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-30 09:31:22 +02:00
yshui and GitHub
6ec951763e
Merge branch 'next' into more-xcb-conv
2018-09-30 04:53:34 +01:00
Uli Schlachter and Yuxuan Shui
aedea014a9
Replace XFixes initialisation with xcb
...
XFixesQueryExtension() does an XFixes QueryVersion request internally,
so one was added here.
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-29 17:02:44 +01:00
Uli Schlachter
529306e65f
Convert usage of XCreatePixmap to xcb
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-29 12:00:18 +02:00
Uli Schlachter
ea9942b87e
Replace use of XFreePixmap with XCB
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-29 11:53:30 +02:00
Uli Schlachter
9dff55540f
Convert Xinerama usage to xcb
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-29 11:48:58 +02:00
Uli Schlachter
83a4853419
Convert use of SHAPE extension to XCB
...
Signed-off-by: Uli Schlachter <psychon@znc.in >
2018-09-29 11:48:58 +02:00