mirror of
https://github.com/lbonn/rofi
synced 2024-11-10 06:14:14 +00:00
Merge remote-tracking branch 'upstream/next' into wayland
This commit is contained in:
commit
ccb8385d93
8 changed files with 24 additions and 21 deletions
|
@ -42,7 +42,7 @@ You can also use [Meson](https://mesonbuild.com/) as an alternative.
|
|||
|
||||
- libcairo-xcb
|
||||
|
||||
- libglib2.0 >= 2.68
|
||||
- libglib2.0 >= 2.72
|
||||
- gmodule-2.0
|
||||
- gio-unix-2.0
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ dnl ---------------------------------------------------------------------
|
|||
dnl PKG_CONFIG based dependencies
|
||||
dnl ---------------------------------------------------------------------
|
||||
glib_min_major="2"
|
||||
glib_min_minor="40"
|
||||
glib_min_minor="72"
|
||||
glib_min_version="${glib_min_major}.${glib_min_minor}"
|
||||
NK_INIT([bindings xdg-theme])
|
||||
PKG_CHECK_MODULES([glib], [glib-2.0 >= ${glib_min_version} gio-unix-2.0 gmodule-2.0])
|
||||
|
|
|
@ -25,8 +25,8 @@ endif
|
|||
doxy_conf = configuration_data()
|
||||
doxy_conf.set('PACKAGE', meson.project_name())
|
||||
doxy_conf.set('VERSION', meson.project_version())
|
||||
doxy_conf.set('abs_builddir', join_paths(meson.build_root(), meson.current_build_dir()))
|
||||
doxy_conf.set('abs_top_srcdir', meson.source_root())
|
||||
doxy_conf.set('abs_builddir', join_paths(meson.project_build_root(), meson.current_build_dir()))
|
||||
doxy_conf.set('abs_top_srcdir', meson.project_source_root())
|
||||
|
||||
doxyfile = configure_file(
|
||||
input: 'rofi.doxy.in',
|
||||
|
|
|
@ -672,11 +672,11 @@ t_property_scale_type
|
|||
|
||||
t_color_list
|
||||
: t_property_color {
|
||||
$$ = g_list_append ( NULL, g_memdup ( (gconstpointer)&($1), sizeof ( ThemeColor )));
|
||||
$$ = g_list_append ( NULL, g_memdup2 ( (gconstpointer)&($1), sizeof ( ThemeColor )));
|
||||
}
|
||||
| t_color_list T_COMMA t_property_color {
|
||||
|
||||
$$ = g_list_append ($1, g_memdup ( (gconstpointer)&($3), sizeof ( ThemeColor )));
|
||||
$$ = g_list_append ($1, g_memdup2 ( (gconstpointer)&($3), sizeof ( ThemeColor )));
|
||||
}
|
||||
;
|
||||
|
||||
|
|
12
meson.build
12
meson.build
|
@ -1,6 +1,6 @@
|
|||
project('rofi', 'c',
|
||||
version: '1.7.5+wayland2-dev',
|
||||
meson_version: '>=0.47.0',
|
||||
meson_version: '>=0.59.0',
|
||||
license: [ 'MIT' ],
|
||||
default_options: [
|
||||
'c_std=c99',
|
||||
|
@ -11,8 +11,8 @@ project('rofi', 'c',
|
|||
c_compiler = meson.get_compiler('c')
|
||||
|
||||
add_project_arguments(
|
||||
'-I@0@'.format(meson.build_root()),
|
||||
'-I@0@'.format(join_paths(meson.source_root(), 'include')),
|
||||
'-I@0@'.format(meson.project_build_root()),
|
||||
'-I@0@'.format(join_paths(meson.project_source_root(), 'include')),
|
||||
'-D_DEFAULT_SOURCE=1',
|
||||
language: 'c'
|
||||
)
|
||||
|
@ -43,7 +43,7 @@ desktop_install_dir = join_paths(get_option('datadir'), 'applications')
|
|||
icondir = join_paths(get_option('datadir'), 'icons','hicolor', 'scalable', 'apps')
|
||||
|
||||
glib_min_major=2
|
||||
glib_min_minor=40
|
||||
glib_min_minor=72
|
||||
glib_min_version='@0@.@1@'.format(glib_min_major, glib_min_minor)
|
||||
plugins_deps = [
|
||||
dependency('glib-2.0', version: '>= @0@'.format(glib_min_version)),
|
||||
|
@ -152,7 +152,7 @@ config_h = configure_file(output: 'config.h', configuration: header_conf)
|
|||
|
||||
nk_options = [
|
||||
'bindings=true',
|
||||
'git-work-tree=@0@'.format(meson.source_root()),
|
||||
'git-work-tree=@0@'.format(meson.project_source_root()),
|
||||
]
|
||||
nk = subproject('libnkutils', default_options: nk_options)
|
||||
nk_subproject_options = nk.get_variable('nk_options')
|
||||
|
@ -616,7 +616,7 @@ if cppcheck.found()
|
|||
'--enable=all',
|
||||
'-Uerror_dialog',
|
||||
'--inconclusive',
|
||||
'-I@0@'.format(join_paths(meson.source_root(), 'include')),
|
||||
'-I@0@'.format(join_paths(meson.project_source_root(), 'include')),
|
||||
rofi_sources
|
||||
],
|
||||
)
|
||||
|
|
|
@ -817,7 +817,7 @@ char *rofi_force_utf8(const gchar *data, ssize_t length) {
|
|||
GString *string;
|
||||
|
||||
if (g_utf8_validate(data, length, &end)) {
|
||||
return g_memdup(data, length + 1);
|
||||
return g_memdup2(data, length + 1);
|
||||
}
|
||||
string = g_string_sized_new(length + 16);
|
||||
|
||||
|
|
|
@ -93,10 +93,13 @@ typedef struct {
|
|||
/**
|
||||
* @param cmd The cmd to execute
|
||||
* @param run_in_term Indicate if command should be run in a terminal
|
||||
* @param orig The cmd to store in history
|
||||
*
|
||||
* Execute command and add to history.
|
||||
* Exact entries should be stored unquoted any custom or with filename
|
||||
* should be saved in history quoted.
|
||||
*/
|
||||
static gboolean exec_cmd(const char *cmd, int run_in_term) {
|
||||
static gboolean exec_cmd(const char *cmd, int run_in_term, const char *orig) {
|
||||
GError *error = NULL;
|
||||
if (!cmd || !cmd[0]) {
|
||||
return FALSE;
|
||||
|
@ -120,12 +123,12 @@ static gboolean exec_cmd(const char *cmd, int run_in_term) {
|
|||
* It is allowed to be a bit slower.
|
||||
*/
|
||||
|
||||
history_set(path, cmd);
|
||||
history_set(path, orig);
|
||||
g_free(path);
|
||||
g_free(lf_cmd);
|
||||
return TRUE;
|
||||
}
|
||||
history_remove(path, cmd);
|
||||
history_remove(path, orig);
|
||||
g_free(path);
|
||||
g_free(lf_cmd);
|
||||
return FALSE;
|
||||
|
@ -447,13 +450,13 @@ static ModeMode run_mode_result(Mode *sw, int mretv, char **input,
|
|||
if (retv == MODE_EXIT) {
|
||||
if (path == NULL) {
|
||||
char *arg = g_shell_quote(rmpd->cmd_list[rmpd->selected_line].entry);
|
||||
exec_cmd(arg, run_in_term);
|
||||
exec_cmd(arg, run_in_term, rmpd->cmd_list[rmpd->selected_line].entry);
|
||||
g_free(arg);
|
||||
} else {
|
||||
char *earg = g_shell_quote(rmpd->cmd_list[rmpd->selected_line].entry);
|
||||
char *epath = g_shell_quote(path);
|
||||
char *arg = g_strdup_printf("%s %s", earg, epath);
|
||||
exec_cmd(arg, run_in_term);
|
||||
exec_cmd(arg, run_in_term, arg);
|
||||
g_free(arg);
|
||||
g_free(earg);
|
||||
g_free(epath);
|
||||
|
@ -466,13 +469,13 @@ static ModeMode run_mode_result(Mode *sw, int mretv, char **input,
|
|||
|
||||
if ((mretv & MENU_OK) && rmpd->cmd_list[selected_line].entry != NULL) {
|
||||
char *earg = g_shell_quote(rmpd->cmd_list[selected_line].entry);
|
||||
if (!exec_cmd(earg, run_in_term)) {
|
||||
if (!exec_cmd(earg, run_in_term, rmpd->cmd_list[selected_line].entry)) {
|
||||
retv = RELOAD_DIALOG;
|
||||
}
|
||||
g_free(earg);
|
||||
} else if ((mretv & MENU_CUSTOM_INPUT) && *input != NULL &&
|
||||
*input[0] != '\0') {
|
||||
if (!exec_cmd(*input, run_in_term)) {
|
||||
if (!exec_cmd(*input, run_in_term, *input)) {
|
||||
retv = RELOAD_DIALOG;
|
||||
}
|
||||
} else if ((mretv & MENU_ENTRY_DELETE) &&
|
||||
|
|
|
@ -170,7 +170,7 @@ Property *rofi_theme_property_copy(const Property *p,
|
|||
for (GList *l = g_list_first(p->value.image.colors); l;
|
||||
l = g_list_next(l)) {
|
||||
retv->value.image.colors = g_list_append(
|
||||
retv->value.image.colors, g_memdup(l->data, sizeof(ThemeColor)));
|
||||
retv->value.image.colors, g_memdup2(l->data, sizeof(ThemeColor)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue