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

Cannot change border size in qubes-desktop-linux-i3 #6589

Open
jmickelin opened this issue May 9, 2021 · 5 comments · May be fixed by QubesOS/qubes-desktop-linux-i3#53
Open

Cannot change border size in qubes-desktop-linux-i3 #6589

jmickelin opened this issue May 9, 2021 · 5 comments · May be fixed by QubesOS/qubes-desktop-linux-i3#53
Labels
affects-4.1 This issue affects Qubes OS 4.1. affects-4.2 This issue affects Qubes OS 4.2. C: desktop-linux-i3 Support for the i3 tiling window manager diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@jmickelin
Copy link

Qubes OS version
R4.0

Affected component(s) or functionality
qubes-desktop-linux-i3 version 1000:4.16-9.fc25.

Brief summary
It seems the default_border setting and the border command are ignored.

How Reproducible
Every time

To Reproduce
Steps to reproduce the behavior:

  1. Add the following lines to ~/.config/i3/config in dom0:
    default_border pixel 10
    for_window [ class="Firefox" ] border pixel 30
    
  2. Open a terminal
  3. Open a Firefox window

Expected behavior
The terminal window should have a border size of 10 pixels.

The Firefox window should have a border size of 30 pixels.

Actual behavior
Border size is unaffected in both cases.

Additional context
I think this is caused by the following line in the Qubes patch for i3:
https://github.com/QubesOS/qubes-desktop-linux-i3/blob/93b8b1ba9d41f56c85bea4752a7270fe1468fb36/0001-Show-qubes-domain-in-configurable-colored-borders.patch#L180

Following the Git blame, it seems that this was first introduced when bumping the upstream version to 4.16. Comparing it with the patch for version 4.15 and using the then-upstream repo as reference, it looks like the previous behavior was to only override the width when the upstream one set it to a constant value, and using the user-supplied value in all other cases. The bump to 4.16 changed this to be overridden in all instances, presumably by mistake.

In order to follow a similar behavior as in previous versions, the patch should instead produce code akin to:

static int border_width_from_style(border_style_t border_style, long border_width, Con *con) {
    if (border_style != BS_NONE && border_width >= 0) {
        return logical_px(border_width);
    }

    const bool is_floating = con_inside_floating(con) != NULL;
    /* Load the configured defaults. */
    if (is_floating && border_style == config.default_floating_border) {
        return config.default_floating_border_width;
    } else if (!is_floating && border_style == config.default_border) {
        return config.default_border_width;
    } else {
        /* border_style is BS_NONE or the default styles are not applicable  */
        return 3;
    }
 }

(NOTE: The above code has not been tested.)

Solutions you've tried
I configured both with really exaggerated border sizes (as above) to make sure I definitely would notice if it worked.

I have confirmed that the Firefox window is matched correctly by modifying other settings on it with for_window, it's just the border command that is broken.

I have successfully used these settings in i3 on non-Qubes machines previously.

Relevant documentation you've consulted
https://i3wm.org/docs/userguide.html#_default_border_style_for_new_windows
https://i3wm.org/docs/userguide.html#_changing_border_style
https://i3wm.org/docs/userguide.html#for_window

Related, non-duplicate issues
None

@jmickelin jmickelin added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels May 9, 2021
@jmickelin
Copy link
Author

I'd be happy to supply a PR, but I'm not sure where to begin to set up a build environment for this. Let me know if you need the help and I can try reading up on it.

@andrewdavidwong andrewdavidwong added the C: desktop-linux-i3 Support for the i3 tiling window manager label May 9, 2021
@andrewdavidwong andrewdavidwong added this to the Release 4.0 updates milestone May 9, 2021
@andrewdavidwong
Copy link
Member

I'd be happy to supply a PR, but I'm not sure where to begin to set up a build environment for this. Let me know if you need the help and I can try reading up on it.

I'm sure that would be appreciated, thank you! The dev documentation might have what you need to set up a build environment: https://www.qubes-os.org/doc/#developer-documentation

@andrewdavidwong andrewdavidwong added the eol-4.0 Closed since Qubes 4.0 has been EOL for over one year label Aug 5, 2023
@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This issue is being closed because:

If anyone believes that this issue should be reopened and reassigned to an active milestone, please leave a brief comment.
(For example, if a bug still affects Qubes OS 4.1, then the comment "Affects 4.1" will suffice.)

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2023
@jmickelin
Copy link
Author

jmickelin commented Nov 27, 2023

Affects 4.1

Sorry, I never got around to figuring out how to set up a build environment for dom0, so I could never test the code and I sort of let this ticket stagnate. The upstream code is still missing from the Qubes-patched version, so it should be reincorporated following my previous sleuth work above. Though it might need to be massaged a bit in case it's bitrotted in the time since I posted.

@andrewdavidwong andrewdavidwong removed this from the Release 4.0 updates milestone Nov 27, 2023
@andrewdavidwong andrewdavidwong added affects-4.1 This issue affects Qubes OS 4.1. diagnosed Technical diagnosis has been performed (see issue comments). and removed eol-4.0 Closed since Qubes 4.0 has been EOL for over one year labels Nov 27, 2023
DemiMarie added a commit to DemiMarie/qubes-desktop-linux-i3 that referenced this issue Nov 28, 2023
Instead of making the border width a hardcoded constant, specify a
minimum value (3) but allow users to increase it.

Fixes: QubesOS/qubes-issues#6589
@neoniobium
Copy link

Affects 4.2.

@andrewdavidwong andrewdavidwong added affects-4.2 This issue affects Qubes OS 4.2. pr submitted A pull request has been submitted for this issue. labels Dec 24, 2023
DemiMarie added a commit to DemiMarie/qubes-desktop-linux-i3 that referenced this issue May 15, 2024
Instead of making the border width a hardcoded constant, specify a
minimum value (3) but allow users to increase it.

Fixes: QubesOS/qubes-issues#6589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.1 This issue affects Qubes OS 4.1. affects-4.2 This issue affects Qubes OS 4.2. C: desktop-linux-i3 Support for the i3 tiling window manager diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants