Compare commits

..

10 commits

Author SHA1 Message Date
Johan Malm
c9030dcc5b CI: fix broken FreeBSD CI by setting -Dlibsfdo:b_ndebug=false
...because with with

    meson setup build -Dbuildtype=release -Db_ndebug=true \
        --werror --force-fallback-for=libsfdo

we get the following warning:

    In file included from ../subprojects/libsfdo/common/dirs.c:5:
    ../subprojects/libsfdo/include/common/membuild.h: In function ‘sfdo_membuild_validate’:
    ../subprojects/libsfdo/include/common/membuild.h:29:65: error: unused parameter ‘membuild’ [-Werror=unused-parameter]
       29 | static inline void sfdo_membuild_validate(struct sfdo_membuild *membuild) {

...because `sfdo_membuild_validate()` contains nothing but an `assert()`
and that therefore results in an `unused-parameter` warning with `NDEBUG`.

https://gitlab.freedesktop.org/vyivel/libsfdo/-/blob/main/include/common/membuild.h?ref_type=heads#L30
2025-09-26 19:06:21 +02:00
Johan Malm
26bd02d457 Add translate.h for HAVE_NLS includes/defines
...to shrink labwc.h footprint
2025-09-26 10:43:23 -04:00
Johan Malm
1692c47fa0 Remove unused function key_state_nr_pressed_keys() 2025-09-26 10:41:21 -04:00
Johan Malm
bdc8e1c546 Remove unused function lab_xml_get_node() 2025-09-26 10:41:21 -04:00
Johan Malm
ee87b4fc30 Remove unused function trim_last_field() 2025-09-26 10:41:21 -04:00
Johan Malm
34e52a40c7 Remove unused function node_layer_popup_from_node() 2025-09-26 10:41:21 -04:00
Johan Malm
139a5f0383 Remove unused function output_max_scale() 2025-09-26 10:41:21 -04:00
Johan Malm
0bf2678f9d Remove unused function scaled_font_buffer_set_max_width() 2025-09-26 10:41:21 -04:00
Johan Malm
6bbdc3c6dc Remove unused function menu_call_actions() 2025-09-26 10:41:21 -04:00
Johan Malm
7a5b7aa378 rcxml.h: minor tweaks to order of variables 2025-09-25 21:12:36 +01:00
22 changed files with 23 additions and 121 deletions

View file

@ -168,6 +168,7 @@ jobs:
meson setup build-gcc-release -Dxwayland=enabled \
-Dbuildtype=release -Db_ndebug=true --werror
meson configure build-gcc-release -Dwlroots:b_ndebug=false || true
meson configure build-gcc-release -Dlibsfdo:b_ndebug=false || true
meson compile -C build-gcc-release
' | $TARGET
@ -190,6 +191,7 @@ jobs:
meson setup build-clang-release -Dxwayland=enabled \
-Dbuildtype=release -Db_ndebug=true --werror
meson configure build-clang-release -Dwlroots:b_ndebug=false || true
meson configure build-clang-release -Dlibsfdo:b_ndebug=false || true
meson compile -C build-clang-release
' | $TARGET

View file

@ -15,15 +15,6 @@ bool string_null_or_empty(const char *s);
*/
bool str_space_only(const char *s);
/**
* trim_last_field() - Trim last field of string splitting on provided delim
* @buf: string to trim
* @delim: delimitator
*
* Example: With delim='_' and buf="foo_bar_baz" the return value is "foo_bar"
*/
void trim_last_field(char *buf, char delim);
/**
* string_strip - strip white space left and right
* Note: this function does a left skip, so the returning pointer cannot be

View file

@ -30,7 +30,6 @@ void lab_xml_expand_dotted_attributes(xmlNode *root);
/* Returns true if the node only contains a string or is empty */
bool lab_xml_node_is_leaf(xmlNode *node);
bool lab_xml_get_node(xmlNode *node, const char *key, xmlNode **dst_node);
bool lab_xml_get_string(xmlNode *node, const char *key, char *s, size_t len);
bool lab_xml_get_int(xmlNode *node, const char *key, int *i);
bool lab_xml_get_bool(xmlNode *node, const char *key, bool *b);

View file

@ -71,11 +71,12 @@ struct rcxml {
enum tearing_mode allow_tearing;
bool auto_enable_outputs;
bool reuse_output_mode;
enum lab_placement_policy placement_policy;
bool xwayland_persistence;
bool primary_selection;
char *prompt_command;
/* placement */
enum lab_placement_policy placement_policy;
int placement_cascade_offset_x;
int placement_cascade_offset_y;

View file

@ -24,6 +24,5 @@ void key_state_store_pressed_key_as_bound(uint32_t keycode);
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
void key_state_bound_key_remove(uint32_t keycode);
int key_state_nr_bound_keys(void);
int key_state_nr_pressed_keys(void);
#endif /* LABWC_KEY_STATE_H */

View file

@ -7,13 +7,6 @@
#include "common/set.h"
#include "input/cursor.h"
#include "overlay.h"
#if HAVE_NLS
#include <libintl.h>
#include <locale.h>
#define _ gettext
#else
#define _(s) (s)
#endif
#define XCURSOR_DEFAULT "left_ptr"
#define XCURSOR_SIZE 24

View file

@ -100,18 +100,6 @@ void menu_open_root(struct menu *menu, int x, int y);
*/
void menu_process_cursor_motion(struct wlr_scene_node *node);
/**
* menu_call_actions - call actions associated with a menu node
*
* If menuitem connected to @node does not just open a submenu:
* - associated actions will be called
* - server->menu_current will be closed
* - server->menu_current will be set to NULL
*
* Returns true if actions have actually been executed
*/
bool menu_call_actions(struct wlr_scene_node *node);
/**
* menu_close_root- close root menu
*

View file

@ -45,13 +45,6 @@ struct view *node_view_from_node(struct wlr_scene_node *wlr_scene_node);
struct lab_layer_surface *node_layer_surface_from_node(
struct wlr_scene_node *wlr_scene_node);
/**
* node_layer_popup_from_node - return lab_layer_popup struct from node
* @wlr_scene_node: wlr_scene_node from which to return data
*/
struct lab_layer_popup *node_layer_popup_from_node(
struct wlr_scene_node *wlr_scene_node);
/**
* node_menuitem_from_node - return menuitem struct from node
* @wlr_scene_node: wlr_scene_node from which to return data

View file

@ -70,11 +70,4 @@ void handle_output_power_manager_set_mode(struct wl_listener *listener,
void *data);
void output_enable_adaptive_sync(struct output *output, bool enabled);
/**
* output_max_scale() - get maximum scale factor of all usable outputs.
* Used when loading/rendering resources (e.g. icons) that may be
* displayed on any output.
*/
float output_max_scale(struct server *server);
#endif // LABWC_OUTPUT_H

View file

@ -73,12 +73,4 @@ void scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text
int max_width, struct font *font, const float *color,
const float *bg_color);
/**
* Update the max width of an existing auto scaling font buffer
* and force a new render.
*
* No steps are taken to detect if its actually required to render a new buffer.
*/
void scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width);
#endif /* LABWC_SCALED_FONT_BUFFER_H */

14
include/translate.h Normal file
View file

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_TRANSLATE_H
#define LABWC_TRANSLATE_H
#include "config.h"
#if HAVE_NLS
#include <libintl.h>
#include <locale.h>
#define _ gettext
#else
#define _(s) (s)
#endif
#endif /* LABWC_TRANSLATE_H */

View file

@ -5,8 +5,8 @@
#include <wlr/util/log.h>
#include "action.h"
#include "common/buf.h"
#include "labwc.h" /* for gettext */
#include "theme.h"
#include "translate.h"
enum {
LAB_PROMPT_NONE = 0,

View file

@ -20,15 +20,6 @@ string_null_or_empty(const char *s)
return !s || !*s;
}
void
trim_last_field(char *buf, char delim)
{
char *p = strrchr(buf, delim);
if (p) {
*p = '\0';
}
}
static void
rtrim(char *s)
{

View file

@ -164,12 +164,6 @@ get_node(xmlNode *node, const char *key, xmlNode **dst_node, bool leaf_only)
return false;
}
bool
lab_xml_get_node(xmlNode *node, const char *key, xmlNode **dst_node)
{
return get_node(node, key, dst_node, /* leaf_only */ false);
}
bool
lab_xml_get_string(xmlNode *node, const char *key, char *s, size_t len)
{

View file

@ -33,6 +33,7 @@
#include "osd.h"
#include "regions.h"
#include "ssd.h"
#include "translate.h"
#include "view.h"
#include "window-rules.h"
#include "workspaces.h"

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "desktop-entry.h"
#include <locale.h>
#include <sfdo-desktop.h>
#include <sfdo-icon.h>
#include <sfdo-basedir.h>

View file

@ -84,9 +84,3 @@ key_state_nr_bound_keys(void)
{
return bound.size;
}
int
key_state_nr_pressed_keys(void)
{
return pressed.size;
}

View file

@ -11,6 +11,7 @@
#include "config/session.h"
#include "labwc.h"
#include "theme.h"
#include "translate.h"
#include "menu/menu.h"
struct rcxml rc = { 0 };

View file

@ -29,6 +29,7 @@
#include "scaled-buffer/scaled-font-buffer.h"
#include "scaled-buffer/scaled-icon-buffer.h"
#include "theme.h"
#include "translate.h"
#include "view.h"
#include "workspaces.h"
@ -1544,15 +1545,6 @@ menu_process_cursor_motion(struct wlr_scene_node *node)
menu_process_item_selection(item);
}
bool
menu_call_actions(struct wlr_scene_node *node)
{
assert(node && node->data);
struct menuitem *item = node_menuitem_from_node(node);
return menu_execute_item(item);
}
void
menu_close_root(struct server *server)
{

View file

@ -50,15 +50,6 @@ node_layer_surface_from_node(struct wlr_scene_node *wlr_scene_node)
return (struct lab_layer_surface *)node_descriptor->data;
}
struct lab_layer_popup *
node_layer_popup_from_node(struct wlr_scene_node *wlr_scene_node)
{
assert(wlr_scene_node->data);
struct node_descriptor *node_descriptor = wlr_scene_node->data;
assert(node_descriptor->type == LAB_NODE_LAYER_POPUP);
return (struct lab_layer_popup *)node_descriptor->data;
}
struct menuitem *
node_menuitem_from_node(struct wlr_scene_node *wlr_scene_node)
{

View file

@ -1142,17 +1142,3 @@ output_enable_adaptive_sync(struct output *output, bool enabled)
enabled ? "en" : "dis", output->wlr_output->name);
}
}
float
output_max_scale(struct server *server)
{
/* Never return less than 1, in case outputs are disabled */
float scale = 1;
struct output *output;
wl_list_for_each(output, &server->outputs, link) {
if (output_is_usable(output)) {
scale = MAX(scale, output->wlr_output->scale);
}
}
return scale;
}

View file

@ -139,17 +139,3 @@ scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text,
scaled_buffer_request_update(self->scaled_buffer,
self->width, self->height);
}
void
scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width)
{
self->max_width = max_width;
int computed_height;
font_get_buffer_size(self->max_width, self->text, &self->font,
&self->width, &computed_height);
self->height = (self->fixed_height > 0) ?
self->fixed_height : computed_height;
scaled_buffer_request_update(self->scaled_buffer,
self->width, self->height);
}