@@ -188,13 +188,13 @@ impl<'a> Window<'a> {
188188 let xcb_connection = XcbConnection :: new ( ) ?;
189189
190190 // Get screen information (?)
191- let setup = xcb_connection. conn2 . setup ( ) ;
191+ let setup = xcb_connection. conn . setup ( ) ;
192192 let screen = & setup. roots [ xcb_connection. screen ] ;
193193
194194 let parent_id = parent. unwrap_or_else ( || screen. root ) ;
195195
196- let gc_id = xcb_connection. conn2 . generate_id ( ) ?;
197- xcb_connection. conn2 . create_gc (
196+ let gc_id = xcb_connection. conn . generate_id ( ) ?;
197+ xcb_connection. conn . create_gc (
198198 gc_id,
199199 parent_id,
200200 & CreateGCAux :: new ( ) . foreground ( screen. black_pixel ) . graphics_exposures ( 0 ) ,
@@ -234,11 +234,11 @@ impl<'a> Window<'a> {
234234
235235 // For this 32-bith depth to work, you also need to define a color map and set a border
236236 // pixel: https://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c#n818
237- let colormap = xcb_connection. conn2 . generate_id ( ) ?;
238- xcb_connection. conn2 . create_colormap ( ColormapAlloc :: NONE , colormap, screen. root , visual) ?;
237+ let colormap = xcb_connection. conn . generate_id ( ) ?;
238+ xcb_connection. conn . create_colormap ( ColormapAlloc :: NONE , colormap, screen. root , visual) ?;
239239
240- let window_id = xcb_connection. conn2 . generate_id ( ) ?;
241- xcb_connection. conn2 . create_window (
240+ let window_id = xcb_connection. conn . generate_id ( ) ?;
241+ xcb_connection. conn . create_window (
242242 depth,
243243 window_id,
244244 parent_id,
@@ -266,27 +266,27 @@ impl<'a> Window<'a> {
266266 . colormap ( colormap)
267267 . border_pixel ( 0 ) ,
268268 ) ?;
269- xcb_connection. conn2 . map_window ( window_id) ?;
269+ xcb_connection. conn . map_window ( window_id) ?;
270270
271271 // Change window title
272272 let title = options. title ;
273- xcb_connection. conn2 . change_property8 (
273+ xcb_connection. conn . change_property8 (
274274 PropMode :: REPLACE ,
275275 window_id,
276276 AtomEnum :: WM_NAME ,
277277 AtomEnum :: STRING ,
278278 title. as_bytes ( ) ,
279279 ) ?;
280280
281- xcb_connection. conn2 . change_property32 (
281+ xcb_connection. conn . change_property32 (
282282 PropMode :: REPLACE ,
283283 window_id,
284- xcb_connection. atoms2 . WM_PROTOCOLS ,
284+ xcb_connection. atoms . WM_PROTOCOLS ,
285285 AtomEnum :: ATOM ,
286- & [ xcb_connection. atoms2 . WM_DELETE_WINDOW ] ,
286+ & [ xcb_connection. atoms . WM_DELETE_WINDOW ] ,
287287 ) ?;
288288
289- xcb_connection. conn2 . flush ( ) ?;
289+ xcb_connection. conn . flush ( ) ?;
290290
291291 // TODO: These APIs could use a couple tweaks now that everything is internal and there is
292292 // no error handling anymore at this point. Everything is more or less unchanged
@@ -345,11 +345,11 @@ impl<'a> Window<'a> {
345345 let xid = self . inner . xcb_connection . get_cursor ( mouse_cursor) . unwrap ( ) ;
346346
347347 if xid != 0 {
348- let _ = self . inner . xcb_connection . conn2 . change_window_attributes (
348+ let _ = self . inner . xcb_connection . conn . change_window_attributes (
349349 self . inner . window_id ,
350350 & ChangeWindowAttributesAux :: new ( ) . cursor ( xid) ,
351351 ) ;
352- let _ = self . inner . xcb_connection . conn2 . flush ( ) ;
352+ let _ = self . inner . xcb_connection . conn . flush ( ) ;
353353 }
354354
355355 self . inner . mouse_cursor = mouse_cursor;
@@ -371,13 +371,13 @@ impl<'a> Window<'a> {
371371 let scaling = self . inner . window_info . scale ( ) ;
372372 let new_window_info = WindowInfo :: from_logical_size ( size, scaling) ;
373373
374- let _ = self . inner . xcb_connection . conn2 . configure_window (
374+ let _ = self . inner . xcb_connection . conn . configure_window (
375375 self . inner . window_id ,
376376 & ConfigureWindowAux :: new ( )
377377 . width ( new_window_info. physical_size ( ) . width )
378378 . height ( new_window_info. physical_size ( ) . height ) ,
379379 ) ;
380- let _ = self . inner . xcb_connection . conn2 . flush ( ) ;
380+ let _ = self . inner . xcb_connection . conn . flush ( ) ;
381381
382382 // This will trigger a `ConfigureNotify` event which will in turn change `self.window_info`
383383 // and notify the window handler about it
@@ -413,7 +413,7 @@ impl WindowInner {
413413 // when they've all been coalesced.
414414 self . new_physical_size = None ;
415415
416- while let Some ( event) = self . xcb_connection . conn2 . poll_for_event ( ) ? {
416+ while let Some ( event) = self . xcb_connection . conn . poll_for_event ( ) ? {
417417 self . handle_xcb_event ( handler, event) ;
418418 }
419419
@@ -438,7 +438,7 @@ impl WindowInner {
438438 fn run_event_loop ( & mut self , handler : & mut dyn WindowHandler ) -> Result < ( ) , Box < dyn Error > > {
439439 use nix:: poll:: * ;
440440
441- let xcb_fd = self . xcb_connection . conn2 . as_raw_fd ( ) ;
441+ let xcb_fd = self . xcb_connection . conn . as_raw_fd ( ) ;
442442
443443 let mut last_frame = Instant :: now ( ) ;
444444 self . event_loop_running = true ;
@@ -545,7 +545,7 @@ impl WindowInner {
545545 ////
546546 XEvent :: ClientMessage ( event) => {
547547 if event. format == 32
548- && event. data . as_data32 ( ) [ 0 ] == self . xcb_connection . atoms2 . WM_DELETE_WINDOW
548+ && event. data . as_data32 ( ) [ 0 ] == self . xcb_connection . atoms . WM_DELETE_WINDOW
549549 {
550550 self . handle_close_requested ( handler) ;
551551 }
0 commit comments