Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox crashes when downloading a file #179

Closed
Dash-L opened this issue Jun 28, 2021 · 5 comments · Fixed by #186
Closed

Firefox crashes when downloading a file #179

Dash-L opened this issue Jun 28, 2021 · 5 comments · Fixed by #186
Assignees
Labels
bug Something isn't working

Comments

@Dash-L
Copy link

Dash-L commented Jun 28, 2021

Describe the bug

I'll admit this may not actually be a bug in penrose, but I'm at a bit of a loss so let me explain: I currently have xfce4 installed and wanted to switch to penrose, so I create a fairly minimal main.rs, mostly taken from the examples. The problem is, I went to download a wall paper and firefox crashed, after some more testing it seems to crash on any download (though not when I do Right Click -> Save as) and only on penrose, not on xfce4, or spectrwm, which I downloaded to test this. For a bit more testing, I found that this does not happen on chromium, and the difference there is that chromium does not create a popup window, I suspect that it is the popup window that is somehow causing problems.

To Reproduce

Steps to reproduce the behavior:

  1. Open Firefox
  2. Navigate to something to download
  3. Attempt to start the download
  4. Firefox crashes

Expected behavior

The Download popup should appear, and given the right config, float

Versions & OS Details

  • OS: Linux
  • Distribution: Arch
  • Penrose Version: 0.2.0 from crates.io

Additional context

My penrose config (not the most minimal, but the issue still occurs when copying the minimal example config)

#[macro_use]
extern crate penrose;

use penrose::{
    contrib::hooks::LayoutSymbolAsRootName,
    core::{data_types::WinId, helpers::index_selectors, hooks::Hooks, xconnection::XConn, Client},
    draw::{dwm_bar, Color, TextStyle},
    logging_error_handler,
    xcb::{new_xcb_backed_window_manager, XcbConnection, XcbDraw},
    Backward, Config, Forward, Less, More, Result,
};
use simplelog::{LevelFilter, SimpleLogger};
use std::convert::TryFrom;

const FONT: &str = "SauceCodePro Nerd Font";
const HEIGHT: usize = 18;
const BLACK: &str = "#282828";
const WHITE: &str = "#ebdbb2";
const GREY: &str = "#3c3836";
const BLUE: &str = "#458588";

const TERMINAL: &str = "alacritty";
const LAUNCHER: &str = "rofi -show run";

const FLOAT_CLASS: &str = "floating";

fn main() -> penrose::Result<()> {
    if let Err(e) = SimpleLogger::init(LevelFilter::Info, simplelog::Config::default()) {
        panic!("unable to set log level: {}", e);
    }

    let config = Config::default()
        .builder()
        .floating_classes(vec!["rofi", FLOAT_CLASS])
        .build()
        .unwrap();

    let hooks: Hooks<XcbConnection> = vec![
        LayoutSymbolAsRootName::new(),
        Box::new(dwm_bar(
            XcbDraw::new()?,
            HEIGHT,
            &TextStyle {
                font: FONT.to_string(),
                point_size: 9,
                fg: Color::try_from(WHITE)?,
                bg: Some(Color::try_from(BLACK)?),
                padding: (2.0, 2.0),
            },
            Color::try_from(BLUE)?,
            Color::try_from(GREY)?,
            config.workspaces().clone(),
        )?),
    ];

    let key_bindings = gen_keybindings! {
        // Program launchers
        "M-p" => run_external!(LAUNCHER);
        "M-Return" => run_external!(TERMINAL);

        // Lock screen
        "M-l" => run_external!("slock");

        // Client management
        "M-j" => run_internal!(cycle_client, Forward);
        "M-k" => run_internal!(cycle_client, Backward);
        "M-S-j" => run_internal!(drag_client, Forward);
        "M-S-k" => run_internal!(drag_client, Backward);
        "M-S-q" => run_internal!(kill_client);

        // Workspace management
        "M-Tab" => run_internal!(toggle_workspace);
        "M-bracketleft" => run_internal!(cycle_screen, Forward);
        "M-bracketright" => run_internal!(cycle_screen, Backward);
        "M-S-bracketleft" => run_internal!(drag_workspace, Forward);
        "M-S-bracketright" => run_internal!(drag_workspace, Backward);

        // Layout management
        "M-grave" => run_internal!(cycle_layout, Forward);
        "M-S-grave" => run_internal!(cycle_layout, Backward);
        "M-A-Up" => run_internal!(update_max_main, More);
        "M-A-Down" => run_internal!(update_max_main, Less);
        "M-A-Right" => run_internal!(update_main_ratio, Less);
        "M-A-Left" => run_internal!(update_main_ratio, More);

        // Exit penrose
        "M-A-Escape" => run_internal!(exit);

        refmap [ config.ws_range() ] in {
            "M-{}" => focus_workspace [ index_selectors(config.workspaces().len()) ];
            "M-S-{}" => client_to_workspace [ index_selectors(config.workspaces().len()) ];
        };
    };

    let mut wm = new_xcb_backed_window_manager(
        config,
        hooks,
        logging_error_handler(),
    )?;

    wm.grab_keys_and_run(key_bindings, map! {})
}

.penrose.log after just opening firefox and going to download something, it's not on debug mode right now, but I'd be willing to paste that too if it could help:

00:17:51 [INFO] Detected Screen: Screen { wix: 0, true_region: Region { x: 1600, y: 0, w: 1920, h: 1080 }, effective_region: Region { x: 1600, y: 18, w: 1920, h: 1062 } }
00:17:51 [INFO] Detected Screen: Screen { wix: 1, true_region: Region { x: 3520, y: 0, w: 1920, h: 1080 }, effective_region: Region { x: 3520, y: 18, w: 1920, h: 1062 } }
00:17:51 [INFO] Detected Screen: Screen { wix: 2, true_region: Region { x: 0, y: 90, w: 1600, h: 900 }, effective_region: Region { x: 0, y: 108, w: 1600, h: 882 } }
00:17:51 [INFO] Updating known screens: 3 screens detected
00:17:57 [WARN] dropping unknown mouse button event
00:18:23 [WARN] attempt to remove unknown client 33554433
00:18:29 [WARN] attempt to remove unknown client 48234497
00:20:13 [WARN] attempt to remove unknown client 33554433
00:20:13 [WARN] attempt to remove unknown client 33554499
00:20:13 [WARN] attempt to remove unknown client 33554435
00:20:13 [WARN] attempt to remove unknown client 33554448
00:20:13 [WARN] attempt to remove unknown client 33554457
00:20:13 [WARN] attempt to remove unknown client 33554470
00:20:13 [WARN] attempt to remove unknown client 33554486
00:20:28 [WARN] attempt to remove unknown client 46137345
00:20:28 [WARN] attempt to remove unknown client 44040193
00:20:28 [WARN] attempt to remove unknown client 41943041
00:20:28 [WARN] attempt to remove unknown client 39845889
00:20:28 [WARN] attempt to remove unknown client 37748737
00:20:28 [WARN] attempt to remove unknown client 48234497
00:20:28 [WARN] attempt to remove unknown client 48234499
00:20:28 [WARN] attempt to remove unknown client 48234503
00:20:28 [WARN] attempt to remove unknown client 48234503
00:20:37 [WARN] attempt to remove unknown client 33554433
@Dash-L Dash-L added the bug Something isn't working label Jun 28, 2021
@sminez
Copy link
Owner

sminez commented Jun 28, 2021

I think this is actually a duplicate of #129 ?

Can you try running current develop from GitHub (your keybinding definitions might need updating to do so I'm afraid) and see if the issue is still there? I think I have this fixed now but I haven't made a new release to crates.io with it yet.

@Dash-L
Copy link
Author

Dash-L commented Jun 29, 2021

Oh yeah, I had seen that issue but wasn't sure if it was exactly what I was running into. I switched to the develop branch on github, and the crashing from downloading has stopped, however, downloads just don't start anymore, and using kill_client causes firefox to crash, which really just means I then have to kill the crash reporter.

@sminez
Copy link
Owner

sminez commented Jul 1, 2021

I thought that I'd fixed that 😔

For some reason, Firefox seems to be really unhappy about being closed when pretty much every other program is fine. I'll see what I can do but I'm running out of ideas at this stage.

@Dash-L
Copy link
Author

Dash-L commented Jul 2, 2021

Ah all right. The crashing isn't really so bad as the idea is to close it anyway. I haven't had a chance to in the past couple days but this weekend I'll do some more testing around the downloads problem to see if I can find anything out.

@Dash-L
Copy link
Author

Dash-L commented Jul 8, 2021

Well even with debug mode on, I'm not seeing much info that is helpful, and I'm at a loss for what to do. I think for now I'll stick to xfce, but this isn't the first time I've come back to this project after using something else for a while, and I don't think it'll be the last.

@sminez sminez self-assigned this Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants