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

ATLauncher only displays a blank background when launched under Penrose #320

Closed
1 of 2 tasks
Saithe6 opened this issue Jan 21, 2025 · 3 comments
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@Saithe6
Copy link

Saithe6 commented Jan 21, 2025

Describe the bug

ATLauncher only displays a blank background when launched under Penrose
...

To Reproduce

Steps to reproduce the behavior:
Launch a non flatpak version of ATLauncher under penrose

Expected behavior

ATLauncher should display its gui, rather than a blank background
...

Screenshots

If applicable, add screenshots to help explain your problem.
Image

Versions & OS Details

  • OS: Linux
  • Distribution: Fedora
  • OS Version: 41
  • Penrose Version: 0.3.6

Additional context

  • minimal main.rs that reproduces the issue
    basically just the starter config with some keybinds changed so I can actually open rofi to launch ATLauncher. I don't think it's a config issue but just in case
//! penrose :: minimal configuration
//!
//! This file will give you a functional if incredibly minimal window manager that
//! has multiple workspaces and simple client / workspace movement.
use penrose::{
    builtin::{
        actions::{
            exit,
            floating::{sink_focused,MouseDragHandler,MouseResizeHandler},
            modify_with,send_layout_message,spawn,
        },
        layout::messages::{ExpandMain,IncMain,ShrinkMain},
    },
    core::{
        bindings::{
            click_handler,parse_keybindings_with_xmodmap,KeyEventHandler,MouseEventHandler,
            MouseState,
        },
        Config,WindowManager,
    },
    map,
    x11rb::RustConn,
    Result,
};
use std::collections::HashMap;
use tracing_subscriber::{self,prelude::*};

fn raw_key_bindings() -> HashMap<String,Box<dyn KeyEventHandler<RustConn>>> {
    let mut raw_bindings = map! {
        map_keys:|k:&str| k.to_string();

        "M-j" => modify_with(|cs| cs.focus_down()),
        "M-k" => modify_with(|cs| cs.focus_up()),
        "M-S-j" => modify_with(|cs| cs.swap_down()),
        "M-S-k" => modify_with(|cs| cs.swap_up()),
        "M-S-q" => modify_with(|cs| cs.kill_focused()),
        "M-Tab" => modify_with(|cs| cs.toggle_tag()),
        "M-bracketright" => modify_with(|cs| cs.next_screen()),
        "M-bracketleft" => modify_with(|cs| cs.previous_screen()),
        "M-grave" => modify_with(|cs| cs.next_layout()),
        "M-S-grave" => modify_with(|cs| cs.previous_layout()),
        "M-S-Up" => send_layout_message(|| IncMain(1)),
        "M-S-Down" => send_layout_message(|| IncMain(-1)),
        "M-S-Right" => send_layout_message(|| ExpandMain),
        "M-S-Left" => send_layout_message(|| ShrinkMain),
        "M-d" => spawn("rofi -show drun -show-icons"),
        "M-Return" => spawn("wezterm"),
        "M-S-Escape" => exit(),
    };

    for tag in &["1","2","3","4","5","6","7","8","9"] {
        raw_bindings.extend([
            (
                format!("M-{tag}"),
                modify_with(move |client_set| client_set.focus_tag(tag)),
            ),
            (
                format!("M-S-{tag}"),
                modify_with(move |client_set| client_set.move_focused_to_tag(tag)),
            ),
        ]);
    }

    raw_bindings
}

fn mouse_bindings() -> HashMap<MouseState, Box<dyn MouseEventHandler<RustConn>>> {
    use penrose::core::bindings::{
        ModifierKey::{Meta,Shift},
        MouseButton::{Left,Middle,Right},
    };

    map! {
        map_keys: |(button,modifiers)| MouseState {button,modifiers};

        (Left,vec![Shift,Meta]) => MouseDragHandler::boxed_default(),
        (Right,vec![Shift,Meta]) => MouseResizeHandler::boxed_default(),
        (Middle,vec![Shift,Meta]) => click_handler(sink_focused()),
    }
}

fn main() -> Result<()> {
    tracing_subscriber::fmt()
        .with_env_filter("info")
        .finish()
        .init();

    let conn = RustConn::new()?;
    let key_bindings = parse_keybindings_with_xmodmap(raw_key_bindings())?;
    let wm = WindowManager::new(Config::default(),key_bindings,mouse_bindings(),conn)?;

    wm.run()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn bindings_parse_correctly_with_xmodmap() {
        let res = parse_keybindings_with_xmodmap(raw_key_bindings());

        if let Err(e) = res {
            panic!("{e}");
        }
    }
}
  • debug log output
@Saithe6 Saithe6 added the bug Something isn't working label Jan 21, 2025
@sminez
Copy link
Owner

sminez commented Jan 21, 2025

This sounds like an instance of this Java issue that affects a lot of tiling window managers.

@Saithe6
Copy link
Author

Saithe6 commented Jan 21, 2025

That fixed it. This might be the stupidest bug I've ever seen

@sminez
Copy link
Owner

sminez commented Jan 21, 2025

It's quite annoying 😞

@sminez sminez closed this as completed Jan 21, 2025
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

No branches or pull requests

2 participants