mirror of
https://github.com/labwc/labwc.git
synced 2026-02-13 04:27:49 -05:00
window-rules: add fixedPosition property
...to address regression introduced by 57075ce and enables panel/desktop
clients which rely on window rules to remain in the same position when
the usable-area changes (normally because an exclusive layer-shell
clients is started/finished).
Also disallows interactive move/resize, for example by alt +
mouse-press.
Fixes: #1235
This commit is contained in:
parent
9a8a2905ad
commit
368ede7460
7 changed files with 23 additions and 0 deletions
|
|
@ -526,6 +526,12 @@ situation.
|
||||||
*<windowRules><windowRule ignoreFocusRequest="">* [yes|no|default]
|
*<windowRules><windowRule ignoreFocusRequest="">* [yes|no|default]
|
||||||
*ignoreFocusRequest* prevent window to activate itself.
|
*ignoreFocusRequest* prevent window to activate itself.
|
||||||
|
|
||||||
|
*<windowRules><windowRule fixedPosition="">* [yes|no|default]
|
||||||
|
*fixedPosition* disallows interactive move/resize and prevents
|
||||||
|
re-positioning in response to changes in reserved output space, which
|
||||||
|
can be caused by *<margin>* settings or exclusive layer-shell clients
|
||||||
|
such as panels.
|
||||||
|
|
||||||
## ENVIRONMENT VARIABLES
|
## ENVIRONMENT VARIABLES
|
||||||
|
|
||||||
*XCURSOR_THEME* and *XCURSOR_SIZE* are supported to set cursor theme
|
*XCURSOR_THEME* and *XCURSOR_SIZE* are supported to set cursor theme
|
||||||
|
|
|
||||||
|
|
@ -442,6 +442,7 @@
|
||||||
<windowRule title="pcmanfm-desktop*">
|
<windowRule title="pcmanfm-desktop*">
|
||||||
<skipTaskbar>yes</skipTaskbar>
|
<skipTaskbar>yes</skipTaskbar>
|
||||||
<skipWindowSwitcher>yes</skipWindowSwitcher>
|
<skipWindowSwitcher>yes</skipWindowSwitcher>
|
||||||
|
<fixedPosition>yes</fixedPosition>
|
||||||
<action name="MoveTo" x="0" y="0" />
|
<action name="MoveTo" x="0" y="0" />
|
||||||
<action name="ToggleAlwaysOnBottom"/>
|
<action name="ToggleAlwaysOnBottom"/>
|
||||||
</windowRule>
|
</windowRule>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ struct window_rule {
|
||||||
enum property skip_taskbar;
|
enum property skip_taskbar;
|
||||||
enum property skip_window_switcher;
|
enum property skip_window_switcher;
|
||||||
enum property ignore_focus_request;
|
enum property ignore_focus_request;
|
||||||
|
enum property fixed_position;
|
||||||
|
|
||||||
struct wl_list link; /* struct rcxml.window_rules */
|
struct wl_list link; /* struct rcxml.window_rules */
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,8 @@ fill_window_rule(char *nodename, char *content)
|
||||||
set_property(content, ¤t_window_rule->skip_window_switcher);
|
set_property(content, ¤t_window_rule->skip_window_switcher);
|
||||||
} else if (!strcasecmp(nodename, "ignoreFocusRequest")) {
|
} else if (!strcasecmp(nodename, "ignoreFocusRequest")) {
|
||||||
set_property(content, ¤t_window_rule->ignore_focus_request);
|
set_property(content, ¤t_window_rule->ignore_focus_request);
|
||||||
|
} else if (!strcasecmp(nodename, "fixedPosition")) {
|
||||||
|
set_property(content, ¤t_window_rule->fixed_position);
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
} else if (!strcmp(nodename, "name.action")) {
|
} else if (!strcmp(nodename, "name.action")) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "regions.h"
|
#include "regions.h"
|
||||||
#include "resize_indicator.h"
|
#include "resize_indicator.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "window-rules.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
max_move_scale(double pos_cursor, double pos_current,
|
max_move_scale(double pos_cursor, double pos_current,
|
||||||
|
|
@ -34,6 +35,10 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case LAB_INPUT_STATE_MOVE:
|
case LAB_INPUT_STATE_MOVE:
|
||||||
if (view->fullscreen) {
|
if (view->fullscreen) {
|
||||||
|
|
|
||||||
|
|
@ -587,6 +587,10 @@ view_adjust_floating_geometry(struct view *view, struct wlr_box *geometry)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool adjusted = false;
|
bool adjusted = false;
|
||||||
/*
|
/*
|
||||||
* First check whether the view is onscreen. For now, "onscreen"
|
* First check whether the view is onscreen. For now, "onscreen"
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,10 @@ window_rules_get_property(struct view *view, const char *property)
|
||||||
&& !strcasecmp(property, "ignoreFocusRequest")) {
|
&& !strcasecmp(property, "ignoreFocusRequest")) {
|
||||||
return rule->ignore_focus_request;
|
return rule->ignore_focus_request;
|
||||||
}
|
}
|
||||||
|
if (rule->fixed_position
|
||||||
|
&& !strcasecmp(property, "fixedPosition")) {
|
||||||
|
return rule->fixed_position;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return LAB_PROP_UNSPECIFIED;
|
return LAB_PROP_UNSPECIFIED;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue