Fix px suffix for lines/columns not working

This commit is contained in:
Kovid Goyal
2025-05-02 08:11:49 +05:30
parent 6c0e5f09d3
commit be9624bbdd
3 changed files with 5 additions and 5 deletions

2
glfw/wl_window.c vendored
View File

@@ -1069,9 +1069,9 @@ calculate_layer_size(_GLFWwindow *window, uint32_t *width, uint32_t *height) {
if (!*height) *height = monitor_height; if (!*height) *height = monitor_height;
return; return;
} }
debug("Calculating layer shell window size at scale: %f\n", xscale);
const unsigned xsz = config->x_size_in_pixels ? (unsigned)(config->x_size_in_pixels * xscale) : (cell_width * config->x_size_in_cells); const unsigned xsz = config->x_size_in_pixels ? (unsigned)(config->x_size_in_pixels * xscale) : (cell_width * config->x_size_in_cells);
const unsigned ysz = config->y_size_in_pixels ? (unsigned)(config->y_size_in_pixels * yscale) : (cell_height * config->y_size_in_cells); const unsigned ysz = config->y_size_in_pixels ? (unsigned)(config->y_size_in_pixels * yscale) : (cell_height * config->y_size_in_cells);
debug("Calculating layer shell window size at scale: %f cell_size: %u %u sz: %u %u\n", xscale, cell_width, cell_height, xsz, ysz);
if (config->edge == GLFW_EDGE_LEFT || config->edge == GLFW_EDGE_RIGHT) { if (config->edge == GLFW_EDGE_LEFT || config->edge == GLFW_EDGE_RIGHT) {
if (!*height) *height = monitor_height; if (!*height) *height = monitor_height;
double spacing = spacing_x; double spacing = spacing_x;

View File

@@ -37,8 +37,8 @@ func main(cmd *cli.Command, opts *Options, args []string) (rc int, err error) {
return 1, err return 1, err
} }
argv := []string{kitty_exe, "+kitten", "panel", "--toggle-visibility", "--exclusive-zone=0", "--override-exclusive-zone", "--layer=overlay", "--single-instance"} argv := []string{kitty_exe, "+kitten", "panel", "--toggle-visibility", "--exclusive-zone=0", "--override-exclusive-zone", "--layer=overlay", "--single-instance"}
argv = append(argv, fmt.Sprintf("--lines=%d", conf.Lines)) argv = append(argv, fmt.Sprintf("--lines=%s", conf.Lines))
argv = append(argv, fmt.Sprintf("--columns=%d", conf.Columns)) argv = append(argv, fmt.Sprintf("--columns=%s", conf.Columns))
argv = append(argv, fmt.Sprintf("--edge=%s", conf.Edge)) argv = append(argv, fmt.Sprintf("--edge=%s", conf.Edge))
if conf.Margin_top != 0 { if conf.Margin_top != 0 {
argv = append(argv, fmt.Sprintf("--margin-top=%d", conf.Margin_top)) argv = append(argv, fmt.Sprintf("--margin-top=%d", conf.Margin_top))

View File

@@ -19,13 +19,13 @@ opt = definition.add_option
agr('qat', 'Window appearance') agr('qat', 'Window appearance')
opt('lines', '25', option_type='positive_int', opt('lines', '25',
long_text=''' long_text='''
The number of lines shown in the window, when the window is along the top or bottom edges of the screen. The number of lines shown in the window, when the window is along the top or bottom edges of the screen.
If it has the suffix :code:`px` then it sets the height of the window in pixels instead of lines. If it has the suffix :code:`px` then it sets the height of the window in pixels instead of lines.
''',) ''',)
opt('columns', '80', option_type='positive_int', opt('columns', '80',
long_text=''' long_text='''
The number of columns shown in the window, when the window is along the left or right edges of the screen. The number of columns shown in the window, when the window is along the left or right edges of the screen.
If it has the suffix :code:`px` then it sets the width of the window in pixels instead of columns. If it has the suffix :code:`px` then it sets the width of the window in pixels instead of columns.