Skip to content

Commit 6db9498

Browse files
author
Simon Spannagel
committed
Remove wayland fix for good
Signed-off-by: simonspa <simonspa@kth.se>
1 parent 32760ba commit 6db9498

File tree

4 files changed

+0
-130
lines changed

4 files changed

+0
-130
lines changed

src/platform/linux.rs

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -426,104 +426,11 @@ pub fn is_login_wayland() -> bool {
426426
}
427427
}
428428

429-
pub fn fix_login_wayland() {
430-
let mut file = "/etc/gdm3/custom.conf".to_owned();
431-
if !std::path::Path::new(&file).exists() {
432-
file = "/etc/gdm/custom.conf".to_owned();
433-
}
434-
match std::process::Command::new("pkexec")
435-
.args(vec![
436-
"sed",
437-
"-i",
438-
"s/#WaylandEnable=false/WaylandEnable=false/g",
439-
&file,
440-
])
441-
.output()
442-
{
443-
Ok(x) => {
444-
let x = String::from_utf8_lossy(&x.stderr);
445-
if !x.is_empty() {
446-
log::error!("fix_login_wayland failed: {}", x);
447-
}
448-
}
449-
Err(err) => {
450-
log::error!("fix_login_wayland failed: {}", err);
451-
}
452-
}
453-
}
454-
455429
pub fn current_is_wayland() -> bool {
456430
let dtype = get_display_server();
457431
return "wayland" == dtype && unsafe { UNMODIFIED };
458432
}
459433

460-
pub fn modify_default_login() -> String {
461-
let dsession = std::env::var("DESKTOP_SESSION").unwrap();
462-
let user_name = std::env::var("USERNAME").unwrap();
463-
if let Ok(x) = run_cmds("ls /usr/share/* | grep ${DESKTOP_SESSION}-xorg.desktop".to_owned()) {
464-
if x.trim_end().to_string() != "" {
465-
match std::process::Command::new("pkexec")
466-
.args(vec![
467-
"sed",
468-
"-i",
469-
&format!("s/={0}$/={0}-xorg/g", &dsession),
470-
&format!("/var/lib/AccountsService/users/{}", &user_name),
471-
])
472-
.output()
473-
{
474-
Ok(x) => {
475-
let x = String::from_utf8_lossy(&x.stderr);
476-
if !x.is_empty() {
477-
log::error!("modify_default_login failed: {}", x);
478-
return "Fix failed! Please re-login with X server manually".to_owned();
479-
} else {
480-
unsafe {
481-
UNMODIFIED = false;
482-
}
483-
return "".to_owned();
484-
}
485-
}
486-
Err(err) => {
487-
log::error!("modify_default_login failed: {}", err);
488-
return "Fix failed! Please re-login with X server manually".to_owned();
489-
}
490-
}
491-
} else if let Ok(z) =
492-
run_cmds("ls /usr/share/* | grep ${DESKTOP_SESSION:0:-8}.desktop".to_owned())
493-
{
494-
if z.trim_end().to_string() != "" {
495-
match std::process::Command::new("pkexec")
496-
.args(vec![
497-
"sed",
498-
"-i",
499-
&format!("s/={}$/={}/g", &dsession, &dsession[..dsession.len() - 8]),
500-
&format!("/var/lib/AccountsService/users/{}", &user_name),
501-
])
502-
.output()
503-
{
504-
Ok(x) => {
505-
let x = String::from_utf8_lossy(&x.stderr);
506-
if !x.is_empty() {
507-
log::error!("modify_default_login failed: {}", x);
508-
return "Fix failed! Please re-login with X server manually".to_owned();
509-
} else {
510-
unsafe {
511-
UNMODIFIED = false;
512-
}
513-
return "".to_owned();
514-
}
515-
}
516-
Err(err) => {
517-
log::error!("modify_default_login failed: {}", err);
518-
return "Fix failed! Please re-login with X server manually".to_owned();
519-
}
520-
}
521-
}
522-
}
523-
}
524-
return "Fix failed! Please re-login with X server manually".to_owned();
525-
}
526-
527434
// to-do: test the other display manager
528435
fn _get_display_manager() -> String {
529436
if let Ok(x) = std::fs::read_to_string("/etc/X11/default-display-manager") {

src/ui.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,10 @@ impl UI {
434434
is_login_wayland()
435435
}
436436

437-
fn fix_login_wayland(&mut self) {
438-
fix_login_wayland()
439-
}
440-
441437
fn current_is_wayland(&mut self) -> bool {
442438
current_is_wayland()
443439
}
444440

445-
fn modify_default_login(&mut self) -> String {
446-
modify_default_login()
447-
}
448-
449441
fn get_software_update_url(&self) -> String {
450442
get_software_update_url()
451443
}
@@ -590,9 +582,7 @@ impl sciter::EventHandler for UI {
590582
fn is_installed_daemon(bool);
591583
fn get_error();
592584
fn is_login_wayland();
593-
fn fix_login_wayland();
594585
fn current_is_wayland();
595-
fn modify_default_login();
596586
fn get_options();
597587
fn get_option(String);
598588
fn get_local_option(String);

src/ui/index.tis

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,6 @@ class FixWayland: Reactor.Component {
755755
</div>;
756756
}
757757

758-
event click $(#fix-wayland) {
759-
handler.fix_login_wayland();
760-
app.update();
761-
}
762-
763758
event click $(#help-me) {
764759
handler.open_url(translate("doc_fix_wayland"));
765760
}
@@ -774,14 +769,6 @@ class ModifyDefaultLogin: Reactor.Component {
774769
</div>;
775770
}
776771

777-
event click $(#modify-default-login) {
778-
if (var r = handler.modify_default_login()) {
779-
// without handler, will fail, fucking stupid sciter
780-
handler.msgbox("custom-error", "Error", r);
781-
}
782-
app.update();
783-
}
784-
785772
event click $(#help-me) {
786773
handler.open_url(translate("doc_fix_wayland"));
787774
}

src/ui_interface.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,6 @@ pub fn is_login_wayland() -> bool {
614614
return false;
615615
}
616616

617-
#[inline]
618-
pub fn fix_login_wayland() {
619-
#[cfg(target_os = "linux")]
620-
crate::platform::linux::fix_login_wayland();
621-
}
622-
623617
#[inline]
624618
pub fn current_is_wayland() -> bool {
625619
#[cfg(target_os = "linux")]
@@ -628,14 +622,6 @@ pub fn current_is_wayland() -> bool {
628622
return false;
629623
}
630624

631-
#[inline]
632-
pub fn modify_default_login() -> String {
633-
#[cfg(target_os = "linux")]
634-
return crate::platform::linux::modify_default_login();
635-
#[cfg(not(target_os = "linux"))]
636-
return "".to_owned();
637-
}
638-
639625
#[inline]
640626
pub fn get_software_update_url() -> String {
641627
SOFTWARE_UPDATE_URL.lock().unwrap().clone()

0 commit comments

Comments
 (0)