@@ -4,33 +4,32 @@ Window type used with the XCB API.
4
4
mutable struct XCBWindow <: AbstractWindow
5
5
conn:: Connection
6
6
id:: xcb_window_t
7
- parent_id:: xcb_window_t
8
- visual_id:: xcb_visualid_t
7
+ screen:: xcb_screen_t
9
8
delete_request:: xcb_atom_t
10
9
gc:: Union{Nothing,GraphicsContext}
11
10
end
12
11
13
12
"""
14
- Create a new window whose parent is given by `parent_id` and visual by `visual_id `.
13
+ Create a new window on the provided `screen `.
15
14
"""
16
- function XCBWindow (conn, parent_id, visual_id ; depth= XCB_COPY_FROM_PARENT, x= 0 , y= 0 , width= 512 , height= 512 , border_width= 1 , class= XCB_WINDOW_CLASS_INPUT_OUTPUT, window_title= " " , icon_title= nothing , map= true , attributes= [], values= [])
15
+ function XCBWindow (conn, screen :: xcb_screen_t ; depth= XCB_COPY_FROM_PARENT, x= 0 , y= 0 , width= 512 , height= 512 , border_width= 1 , class= XCB_WINDOW_CLASS_INPUT_OUTPUT, window_title= " " , icon_title= nothing , map= true , attributes= [], values= [])
17
16
win_id = xcb_generate_id (conn)
18
17
xcb_create_window (
19
18
conn,
20
19
depth,
21
20
win_id,
22
- parent_id ,
21
+ screen . root ,
23
22
x,
24
23
y,
25
24
width,
26
25
height,
27
26
border_width,
28
27
class,
29
- visual_id ,
28
+ screen . root_visual ,
30
29
0 ,
31
30
C_NULL ,
32
31
)
33
- win = XCBWindow (conn, win_id, parent_id, visual_id , delete_request (conn, win_id), nothing )
32
+ win = XCBWindow (conn, win_id, screen , delete_request (conn, win_id), nothing )
34
33
35
34
set_event_mask (win, keys (event_type_bits))
36
35
set_attributes (win, attributes, values)
@@ -44,11 +43,6 @@ function XCBWindow(conn, parent_id, visual_id; depth=XCB_COPY_FROM_PARENT, x=0,
44
43
Base. finalizer (x -> @check (:error , xcb_destroy_window (x. conn, x. id)), win)
45
44
end
46
45
47
- """
48
- Create a new window on the provided `screen`.
49
- """
50
- XCBWindow (conn:: Connection , screen; kwargs... ) = XCBWindow (conn, screen. root, screen. root_visual; kwargs... )
51
-
52
46
"""
53
47
Create a new window on the current screen.
54
48
"""
0 commit comments