@@ -16,20 +16,21 @@ mod graphics;
16
16
impl DesktopEntry < ' _ > {
17
17
/// Launch the given desktop entry either via dbus or via its `Exec` key with the default gpu or
18
18
/// the alternative one if available.
19
- pub fn launch ( & self , uris : & [ & str ] , prefer_non_default_gpu : bool ) -> Result < ( ) , ExecError > {
19
+ pub fn launch ( & self , uris : & [ & str ] ) -> Result < ( ) , ExecError > {
20
+
20
21
match Connection :: session ( ) {
21
22
Ok ( conn) => {
22
23
if self . is_bus_actionable ( & conn) {
23
- self . dbus_launch ( & conn, uris, prefer_non_default_gpu )
24
+ self . dbus_launch ( & conn, uris)
24
25
} else {
25
- self . shell_launch ( uris, prefer_non_default_gpu )
26
+ self . shell_launch ( uris)
26
27
}
27
28
}
28
- Err ( _) => self . shell_launch ( uris, prefer_non_default_gpu ) ,
29
+ Err ( _) => self . shell_launch ( uris) ,
29
30
}
30
31
}
31
32
32
- fn shell_launch ( & self , uris : & [ & str ] , prefer_non_default_gpu : bool ) -> Result < ( ) , ExecError > {
33
+ fn shell_launch ( & self , uris : & [ & str ] ) -> Result < ( ) , ExecError > {
33
34
let exec = self . exec ( ) ;
34
35
if exec. is_none ( ) {
35
36
return Err ( ExecError :: MissingExecKey ( self . path ) ) ;
@@ -68,7 +69,7 @@ impl DesktopEntry<'_> {
68
69
let args = format ! ( "{terminal} {separator} {exec_args}" ) ;
69
70
let args = [ "-c" , & args] ;
70
71
let mut cmd = Command :: new ( shell) ;
71
- if prefer_non_default_gpu {
72
+ if self . prefers_non_default_gpu ( ) {
72
73
with_non_default_gpu ( cmd)
73
74
} else {
74
75
cmd
@@ -79,7 +80,7 @@ impl DesktopEntry<'_> {
79
80
} else {
80
81
let mut cmd = Command :: new ( shell) ;
81
82
82
- if prefer_non_default_gpu {
83
+ if self . prefers_non_default_gpu ( ) {
83
84
with_non_default_gpu ( cmd)
84
85
} else {
85
86
cmd
0 commit comments