mirror of
https://github.com/labwc/labwc.git
synced 2026-03-02 01:40:24 -05:00
rcxml: discourage empty strings in rc.xml configuration
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Background: I rewrote the config parser in 9462457..2f414a4, but it broke certain configurations by changing how empty strings are handled: they were mostly just ignored before my parser rewrite, but after that, they are interpreted as just empty strings (output="" is considered as 'output named ""'). Though that was unintentional, I believe ignoring empty strings was not a good idea in the first place, as we already allow empty strings for certain configurations (e.g. `<desktop prefix="">`), which makes the parser's behavior inconsistent. Change: So let's clarify that we intend to read empty strings as empty strings. As a preparation, this commit adds warnings for empty strings we are currently ignoring, so that users can be informed that we intend to just read empty strings (e.g. `<theme name="">`) as empty strings in the future. I removed existing empty strings in `rc.xml.all` to avoid warnings when reading it.
This commit is contained in:
parent
a5db8e477a
commit
06505d24c8
2 changed files with 31 additions and 23 deletions
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
<!-- <font><theme> can be defined without an attribute to set all places -->
|
<!-- <font><theme> can be defined without an attribute to set all places -->
|
||||||
<theme>
|
<theme>
|
||||||
<name></name>
|
<!-- <name>Numix</name> -->
|
||||||
<icon></icon>
|
<!-- <icon>breeze</icon> -->
|
||||||
<fallbackAppIcon>labwc</fallbackAppIcon>
|
<fallbackAppIcon>labwc</fallbackAppIcon>
|
||||||
<titlebar>
|
<titlebar>
|
||||||
<layout>icon:iconify,max,close</layout>
|
<layout>icon:iconify,max,close</layout>
|
||||||
|
|
@ -218,9 +218,9 @@
|
||||||
space automatically, so <margin> is only intended for other, specialist
|
space automatically, so <margin> is only intended for other, specialist
|
||||||
cases.
|
cases.
|
||||||
|
|
||||||
If output is left empty, the margin will be applied to all outputs.
|
If 'output' is not provided, the margin will be applied to all outputs.
|
||||||
|
|
||||||
<margin top="" bottom="" left="" right="" output="" />
|
<margin top="10" bottom="10" left="10" right="10" output="HDMI-A-1" />
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Percent based regions based on output usable area, % char is required -->
|
<!-- Percent based regions based on output usable area, % char is required -->
|
||||||
|
|
@ -525,7 +525,11 @@
|
||||||
If mouseEmulation is enabled, all touch up/down/motion events are
|
If mouseEmulation is enabled, all touch up/down/motion events are
|
||||||
translated to mouse button and motion events.
|
translated to mouse button and motion events.
|
||||||
-->
|
-->
|
||||||
<touch deviceName="" mapToOutput="" mouseEmulation="no"/>
|
<touch>
|
||||||
|
<!-- <deviceName>ELAN2514:00 04F3:2AF1<deviceName> -->
|
||||||
|
<!-- <mapToOutput>HDMI-A-1</mapToOutput> -->
|
||||||
|
<mouseEmulation>no</mouseEmulation>
|
||||||
|
</touch>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The tablet cursor movement can be restricted to a single output.
|
The tablet cursor movement can be restricted to a single output.
|
||||||
|
|
@ -552,7 +556,8 @@
|
||||||
When using mouse emulation, the pen tip [tip] and the stylus buttons
|
When using mouse emulation, the pen tip [tip] and the stylus buttons
|
||||||
can be set to any available mouse button [Left|Right|Middle|..|Task].
|
can be set to any available mouse button [Left|Right|Middle|..|Task].
|
||||||
-->
|
-->
|
||||||
<tablet mapToOutput="" rotate="0" mouseEmulation="no">
|
<tablet rotate="0" mouseEmulation="no">
|
||||||
|
<!-- <mapToOutput>HDMI-A-1</mapToOutput> -->
|
||||||
<!-- Active area dimensions are in mm -->
|
<!-- Active area dimensions are in mm -->
|
||||||
<area top="0.0" left="0.0" width="0.0" height="0.0" />
|
<area top="0.0" left="0.0" width="0.0" height="0.0" />
|
||||||
<map button="Tip" to="Left" />
|
<map button="Tip" to="Left" />
|
||||||
|
|
@ -586,7 +591,7 @@
|
||||||
- sendEventsMode [yes|no|disabledOnExternalMouse]
|
- sendEventsMode [yes|no|disabledOnExternalMouse]
|
||||||
- calibrationMatrix [six float values split by space]
|
- calibrationMatrix [six float values split by space]
|
||||||
- scrollFactor [float]
|
- scrollFactor [float]
|
||||||
|
|
||||||
The following <libinput>...</libinput> block may not be complete for
|
The following <libinput>...</libinput> block may not be complete for
|
||||||
your requirements. Default values are device specific. Only set an option
|
your requirements. Default values are device specific. Only set an option
|
||||||
if you require to override the default. Valid values must be inserted.
|
if you require to override the default. Valid values must be inserted.
|
||||||
|
|
@ -595,21 +600,21 @@
|
||||||
|
|
||||||
<libinput>
|
<libinput>
|
||||||
<device category="default">
|
<device category="default">
|
||||||
<naturalScroll></naturalScroll>
|
<!-- <naturalScroll>no</naturalScroll> -->
|
||||||
<leftHanded></leftHanded>
|
<!-- <leftHanded>no</leftHanded> -->
|
||||||
<pointerSpeed></pointerSpeed>
|
<!-- <pointerSpeed>0.0</pointerSpeed> -->
|
||||||
<accelProfile></accelProfile>
|
<!-- <accelProfile>adaptive</accelProfile> -->
|
||||||
<tap>yes</tap>
|
<tap>yes</tap>
|
||||||
<tapButtonMap></tapButtonMap>
|
<!-- <tapButtonMap>lrm</tapButtonMap> -->
|
||||||
<tapAndDrag></tapAndDrag>
|
<!-- <tapAndDrag>yes</tapAndDrag> -->
|
||||||
<dragLock></dragLock>
|
<!-- <dragLock>yes</dragLock> -->
|
||||||
<threeFingerDrag></threeFingerDrag>
|
<!-- <threeFingerDrag>yes</threeFingerDrag> -->
|
||||||
<middleEmulation></middleEmulation>
|
<!-- <middleEmulation>no</middleEmulation> -->
|
||||||
<disableWhileTyping></disableWhileTyping>
|
<!-- <disableWhileTyping>yes</disableWhileTyping> -->
|
||||||
<clickMethod></clickMethod>
|
<!-- <clickMethod>buttonAreas</clickMethod> -->
|
||||||
<scrollMethod></scrollMethod>
|
<!-- <scrollMethod>twofinger</scrollMethod> -->
|
||||||
<sendEventsMode></sendEventsMode>
|
<!-- <sendEventsMode>yes</sendEventsMode> -->
|
||||||
<calibrationMatrix></calibrationMatrix>
|
<!-- <calibrationMatrix>1 0 0 0 1 0</calibrationMatrix> -->
|
||||||
<scrollFactor>1.0</scrollFactor>
|
<scrollFactor>1.0</scrollFactor>
|
||||||
</device>
|
</device>
|
||||||
</libinput>
|
</libinput>
|
||||||
|
|
@ -678,7 +683,7 @@
|
||||||
<height>400</height>
|
<height>400</height>
|
||||||
<initScale>2.0</initScale>
|
<initScale>2.0</initScale>
|
||||||
<increment>0.2</increment>
|
<increment>0.2</increment>
|
||||||
<useFilter>true</useFilter>
|
<useFilter>yes</useFilter>
|
||||||
</magnifier>
|
</magnifier>
|
||||||
|
|
||||||
</labwc_config>
|
</labwc_config>
|
||||||
|
|
|
||||||
|
|
@ -714,6 +714,8 @@ fill_libinput_category(xmlNode *node)
|
||||||
char *key, *content;
|
char *key, *content;
|
||||||
LAB_XML_FOR_EACH(node, child, key, content) {
|
LAB_XML_FOR_EACH(node, child, key, content) {
|
||||||
if (string_null_or_empty(content)) {
|
if (string_null_or_empty(content)) {
|
||||||
|
wlr_log(WLR_ERROR, "Empty string is not allowed for "
|
||||||
|
"<libinput><device><%s>. Ignoring.", key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(key, "category")) {
|
if (!strcmp(key, "category")) {
|
||||||
|
|
@ -1076,7 +1078,8 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (str_space_only(content)) {
|
} else if (str_space_only(content)) {
|
||||||
/* ignore empty leaf nodes other than above */
|
wlr_log(WLR_ERROR, "Empty string is not allowed for %s. "
|
||||||
|
"Ignoring.", nodename);
|
||||||
|
|
||||||
/* handle non-empty leaf nodes */
|
/* handle non-empty leaf nodes */
|
||||||
} else if (!strcmp(nodename, "decoration.core")) {
|
} else if (!strcmp(nodename, "decoration.core")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue