mirror of
https://github.com/lbonn/rofi
synced 2024-11-23 12:23:02 +00:00
wayland: quick fix for changing height
We use the surface size of a fullscreen layer to calculate screen size. But when height is recomputed and given as a percentage, this definition becomes self-referencing. Do a quick fix by caching the monitor resolution.
This commit is contained in:
parent
9efa6504c3
commit
396b13f5a8
1 changed files with 16 additions and 1 deletions
|
@ -80,16 +80,31 @@ static struct {
|
|||
guint repaint_source;
|
||||
/** Window fullscreen */
|
||||
gboolean fullscreen;
|
||||
|
||||
int monitor_width;
|
||||
int monitor_height;
|
||||
} WlState = {
|
||||
.flags = MENU_NORMAL,
|
||||
.idle_timeout = 0,
|
||||
.count = 0L,
|
||||
.repaint_source = 0,
|
||||
.fullscreen = FALSE,
|
||||
.monitor_width = 0,
|
||||
.monitor_height = 0,
|
||||
};
|
||||
|
||||
static void wayland_rofi_view_get_current_monitor(int *width, int *height) {
|
||||
display_get_surface_dimensions(width, height);
|
||||
// TODO: handle changing monitor resolution
|
||||
if (WlState.monitor_width == 0 && WlState.monitor_height == 0) {
|
||||
display_get_surface_dimensions(&WlState.monitor_width, &WlState.monitor_height);
|
||||
}
|
||||
|
||||
if (width) {
|
||||
*width = WlState.monitor_width;
|
||||
}
|
||||
if (height) {
|
||||
*height = WlState.monitor_height;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue