#include <wlr/types/wlr_scene.h>
#include "common/graphic-helpers.h"
#include "common/scene-helpers.h"
+#include "common/string-helpers.h"
#include "debug.h"
#include "input/ime.h"
#include "labwc.h"
}
if (node == &view->scene_tree->node) {
const char *app_id = view_get_string_prop(view, "app_id");
- if (!app_id) {
+ if (!string_null_or_empty(app_id)) {
return "view";
}
snprintf(view_name, sizeof(view_name), "view (%s)", app_id);
desktop_entry_icon_lookup(struct server *server, const char *app_id, int size,
float scale)
{
+ if (string_null_or_empty(app_id)) {
+ return NULL;
+ }
+
struct sfdo *sfdo = server->sfdo;
if (!sfdo) {
return NULL;
const char *
desktop_entry_name_lookup(struct server *server, const char *app_id)
{
+ if (string_null_or_empty(app_id)) {
+ return NULL;
+ }
+
struct sfdo *sfdo = server->sfdo;
if (!sfdo) {
return NULL;
const char *identifier = view_get_string_prop(view, "app_id");
/* remove the first two nodes of 'org.' strings */
- if (trim && identifier && !strncmp(identifier, "org.", 4)) {
+ if (trim && !strncmp(identifier, "org.", 4)) {
char *p = (char *)identifier + 4;
p = strchr(p, '.');
if (p) {
view_update_title(struct view *view)
{
assert(view);
- const char *title = view_get_string_prop(view, "title");
- if (!title) {
- return;
- }
ssd_update_title(view->ssd);
-
wl_signal_emit_mutable(&view->events.new_title, NULL);
}
view_update_app_id(struct view *view)
{
assert(view);
- const char *app_id = view_get_string_prop(view, "app_id");
- if (!app_id) {
- return;
- }
-
if (view->ssd_enabled) {
ssd_update_window_icon(view->ssd);
}
-
wl_signal_emit_mutable(&view->events.new_app_id, NULL);
}