File tree Expand file tree Collapse file tree
x11rb-protocol/src/parse_display Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,15 @@ mod tests {
9797 assert_eq ! ( ci, vec![ ConnectAddress :: Socket ( "/tmp/.X11-unix/X0" . into( ) ) ] ) ;
9898 }
9999
100+ #[ test]
101+ fn try_over_unix_display ( ) {
102+ let pd = parse_display_with_file_exists_callback ( "unix:11.0" , |_| false ) . unwrap ( ) ;
103+ let ci = pd. connect_instruction ( ) ;
104+ let ci = ci. collect :: < Vec < _ > > ( ) ;
105+
106+ assert_eq ! ( ci, vec![ ConnectAddress :: Socket ( "/tmp/.X11-unix/X11" . into( ) ) ] ) ;
107+ }
108+
100109 #[ test]
101110 fn try_over_unix_socket_path ( ) {
102111 const SOCKET_PATH : & str = "/path/to/socket" ;
Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ pub fn parse_display_with_file_exists_callback(
7373 return parse_display_direct_path ( dpy_name, file_exists) ;
7474 }
7575 if let Some ( remaining) = dpy_name. strip_prefix ( "unix:" ) {
76- return parse_display_direct_path ( remaining, file_exists) ;
76+ if let Ok ( display) = parse_display_direct_path ( remaining, & file_exists) {
77+ return Ok ( display) ;
78+ }
7779 }
7880
7981 // Everything up to the last '/' is the protocol. This part is optional.
You can’t perform that action at this time.
0 commit comments