mirror of
https://github.com/lbonn/rofi
synced 2025-02-17 05:18:31 +00:00
Merge tag '1.7.2' into wayland
This commit is contained in:
commit
0a0d8333ca
11 changed files with 103 additions and 56 deletions
5
.github/actions/autotools/action.yml
vendored
5
.github/actions/autotools/action.yml
vendored
|
@ -5,6 +5,9 @@ inputs:
|
|||
cc:
|
||||
description: Compiler to use
|
||||
required: true
|
||||
windowmode:
|
||||
description: Enable window mode
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
@ -18,7 +21,7 @@ runs:
|
|||
|
||||
mkdir builddir && cd builddir
|
||||
|
||||
../configure CC=${{ inputs.cc }}
|
||||
../configure CC=${{ inputs.cc }} --${{ inputs.windowmode }}-windowmode
|
||||
shell: bash
|
||||
- id: build
|
||||
run: cd builddir && make
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
v1.7.2: Shellebrations!
|
||||
- [Build] Fix building without window mode enabled.
|
||||
- [Config] Do not print out the 'theme' field in configuration on dump.
|
||||
- [CI] test window mode less build.
|
||||
- Allow configuration block in theme again.
|
||||
|
||||
v1.7.1: Turtley amazing!
|
||||
- [Theme] Fix highlight with only theme.
|
||||
- Updated documentation and landing page (Thanks to RaZ0rr-Two)
|
||||
|
|
|
@ -184,7 +184,8 @@ EXTRA_DIST += \
|
|||
doc/rofi-script.5.markdown \
|
||||
doc/rofi-theme-selector.1.markdown \
|
||||
doc/rofi-sensible-terminal.1.markdown \
|
||||
doc/rofi.1.markdown
|
||||
doc/rofi.1.markdown\
|
||||
README.md
|
||||
|
||||
###
|
||||
# Themes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([rofi], [1.7.1], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/])
|
||||
AC_INIT([rofi], [1.7.2], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/])
|
||||
|
||||
AC_CONFIG_SRCDIR([source/rofi.c])
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
|
|
|
@ -808,7 +808,6 @@ if ( queue == NULL ) {
|
|||
}
|
||||
<INITIAL>. {
|
||||
yytext[yyleng-1] = '\0';
|
||||
fprintf(stderr,"initial found: |%s|\n", yytext);
|
||||
return T_ERROR;
|
||||
}
|
||||
<SECTION>. {
|
||||
|
|
|
@ -313,31 +313,21 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
|
|||
* First have the configuration blocks, then the theme.
|
||||
*/
|
||||
t_main
|
||||
: t_configuration_list t_entry_list_included {
|
||||
: t_entry_list_included {
|
||||
// Dummy at this point.
|
||||
if ( rofi_theme == NULL ) {
|
||||
rofi_theme_reset();
|
||||
}
|
||||
|
||||
rofi_theme_widget_add_properties ( rofi_theme, $2->properties );
|
||||
for ( unsigned int i = 0; i < $2->num_widgets; i++ ) {
|
||||
ThemeWidget *d = $2->widgets[i];
|
||||
rofi_theme_widget_add_properties ( rofi_theme, $1->properties );
|
||||
for ( unsigned int i = 0; i < $1->num_widgets; i++ ) {
|
||||
ThemeWidget *d = $1->widgets[i];
|
||||
rofi_theme_parse_merge_widgets(rofi_theme, d);
|
||||
}
|
||||
rofi_theme_free ( $2 );
|
||||
rofi_theme_free ( $1 );
|
||||
}
|
||||
;
|
||||
|
||||
t_configuration_list:
|
||||
%empty {
|
||||
if ( rofi_configuration == NULL ) {
|
||||
rofi_configuration = g_slice_new0 ( ThemeWidget );
|
||||
rofi_configuration->name = g_strdup ( "Root" );
|
||||
}
|
||||
}
|
||||
| t_configuration_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {};
|
||||
|
||||
|
||||
/**
|
||||
* Small dummy object to make the prefix optional.
|
||||
*/
|
||||
|
@ -359,8 +349,15 @@ t_entry_list {
|
|||
|
||||
|
||||
t_entry_list:
|
||||
%empty {
|
||||
t_entry_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {
|
||||
$$ = $1;
|
||||
}
|
||||
|%empty {
|
||||
$$ = g_slice_new0 ( ThemeWidget );
|
||||
if ( rofi_configuration == NULL ) {
|
||||
rofi_configuration = g_slice_new0 ( ThemeWidget );
|
||||
rofi_configuration->name = g_strdup ( "Root" );
|
||||
}
|
||||
}
|
||||
| t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
project('rofi', 'c',
|
||||
version: '1.7.1+wayland1-dev',
|
||||
version: '1.7.2+wayland1',
|
||||
meson_version: '>=0.47.0',
|
||||
license: [ 'MIT' ],
|
||||
default_options: [
|
||||
|
|
23
releasenotes/1.7.2/release-1.7.2.markdown
Normal file
23
releasenotes/1.7.2/release-1.7.2.markdown
Normal file
|
@ -0,0 +1,23 @@
|
|||
# 1.7.2: Shellebrations!
|
||||
|
||||
A quick in between release, a bug got fixed that caused configurations not working any more in theme files.
|
||||
While this is the desired behaviour, this release reverts it to avoid breaking to many setups.
|
||||
|
||||
# Changelog
|
||||
|
||||
v1.7.2:
|
||||
- [Build] Fix building without window mode enabled.
|
||||
- [Config] Do not print out the 'theme' field in configuration on dump.
|
||||
- [CI] test window mode less build.
|
||||
- Allow configuration block in theme again.
|
||||
|
||||
# Thanks
|
||||
|
||||
Big thanks to everybody reporting issues.
|
||||
Special thanks goes to:
|
||||
|
||||
* Iggy
|
||||
* Quentin Glidic
|
||||
* Danny Colin
|
||||
|
||||
Apologies if I mistyped or missed anybody.
|
|
@ -976,7 +976,11 @@ int main(int argc, char *argv[]) {
|
|||
TICK_N("Parsed theme");
|
||||
}
|
||||
// Parse command line for settings, independent of other -no-config.
|
||||
config_parse_cmd_options();
|
||||
if (list_of_error_msgs == NULL) {
|
||||
// Only call this when there are no errors.
|
||||
// This might clear existing errors.
|
||||
config_parse_cmd_options();
|
||||
}
|
||||
TICK_N("Load cmd config ");
|
||||
|
||||
parse_keys_abe(bindings);
|
||||
|
|
|
@ -1089,7 +1089,9 @@ static void main_loop_x11_event_handler_view(xcb_generic_event_t *event) {
|
|||
case XCB_DESTROY_NOTIFY: {
|
||||
xcb_window_t win = ((xcb_destroy_notify_event_t *)event)->window;
|
||||
if (win != rofi_view_get_window()) {
|
||||
#ifdef WINDOW_MODE
|
||||
window_client_handle_signal(win, FALSE);
|
||||
#endif
|
||||
} else {
|
||||
g_main_loop_quit(xcb->main_loop);
|
||||
}
|
||||
|
@ -1098,7 +1100,9 @@ static void main_loop_x11_event_handler_view(xcb_generic_event_t *event) {
|
|||
case XCB_CREATE_NOTIFY: {
|
||||
xcb_window_t win = ((xcb_create_notify_event_t *)event)->window;
|
||||
if (win != rofi_view_get_window()) {
|
||||
#ifdef WINDOW_MODE
|
||||
window_client_handle_signal(win, TRUE);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -42,18 +42,15 @@
|
|||
ThemeWidget *rofi_configuration = NULL;
|
||||
|
||||
/** Different sources of configuration. */
|
||||
const char *const ConfigSourceStr[] = {
|
||||
"Default",
|
||||
"File",
|
||||
"Rasi File",
|
||||
"Commandline",
|
||||
};
|
||||
const char *const ConfigSourceStr[] = {"Default", "File", "Rasi File",
|
||||
"Commandline", "Don't Display"};
|
||||
/** Enumerator of different sources of configuration. */
|
||||
enum ConfigSource {
|
||||
CONFIG_DEFAULT = 0,
|
||||
CONFIG_FILE = 1,
|
||||
CONFIG_FILE_THEME = 2,
|
||||
CONFIG_CMDLINE = 3
|
||||
CONFIG_CMDLINE = 3,
|
||||
CONFIG_NO_DISPLAY = 4
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -342,7 +339,7 @@ static XrmOption xrmOptions[] = {
|
|||
{.str = &config.theme},
|
||||
NULL,
|
||||
"New style theme file",
|
||||
CONFIG_DEFAULT},
|
||||
CONFIG_DEFAULT | CONFIG_NO_DISPLAY},
|
||||
{xrm_Number,
|
||||
"max-history-size",
|
||||
{.num = &config.max_history_size},
|
||||
|
@ -462,12 +459,12 @@ static void config_parse_cmd_option(XrmOption *option) {
|
|||
switch (option->type) {
|
||||
case xrm_Number:
|
||||
if (find_arg_uint(key, option->value.num) == TRUE) {
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
}
|
||||
break;
|
||||
case xrm_SNumber:
|
||||
if (find_arg_int(key, option->value.snum) == TRUE) {
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
}
|
||||
break;
|
||||
case xrm_String:
|
||||
|
@ -476,25 +473,25 @@ static void config_parse_cmd_option(XrmOption *option) {
|
|||
g_free(option->mem);
|
||||
option->mem = NULL;
|
||||
}
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
}
|
||||
break;
|
||||
case xrm_Boolean:
|
||||
if (find_arg(key) >= 0) {
|
||||
*(option->value.num) = TRUE;
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
} else {
|
||||
g_free(key);
|
||||
key = g_strdup_printf("-no-%s", option->name);
|
||||
if (find_arg(key) >= 0) {
|
||||
*(option->value.num) = FALSE;
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case xrm_Char:
|
||||
if (find_arg_char(key, option->value.charc) == TRUE) {
|
||||
option->source = CONFIG_CMDLINE;
|
||||
option->source = (option->source & ~3) | CONFIG_CMDLINE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -593,7 +590,7 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
|
||||
// Memory
|
||||
(option)->mem = *(option->value.str);
|
||||
option->source = CONFIG_FILE_THEME;
|
||||
option->source = (option->source & ~3) | CONFIG_FILE_THEME;
|
||||
} else if (option->type == xrm_Number) {
|
||||
if (p->type != P_INTEGER) {
|
||||
*error =
|
||||
|
@ -602,7 +599,7 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
return TRUE;
|
||||
}
|
||||
*(option->value.snum) = p->value.i;
|
||||
option->source = CONFIG_FILE_THEME;
|
||||
option->source = (option->source & ~3) | CONFIG_FILE_THEME;
|
||||
} else if (option->type == xrm_SNumber) {
|
||||
if (p->type != P_INTEGER) {
|
||||
*error =
|
||||
|
@ -611,7 +608,7 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
return TRUE;
|
||||
}
|
||||
*(option->value.num) = (unsigned int)(p->value.i);
|
||||
option->source = CONFIG_FILE_THEME;
|
||||
option->source = (option->source & ~3) | CONFIG_FILE_THEME;
|
||||
} else if (option->type == xrm_Boolean) {
|
||||
if (p->type != P_BOOLEAN) {
|
||||
*error =
|
||||
|
@ -620,7 +617,7 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
return TRUE;
|
||||
}
|
||||
*(option->value.num) = (p->value.b);
|
||||
option->source = CONFIG_FILE_THEME;
|
||||
option->source = (option->source & ~3) | CONFIG_FILE_THEME;
|
||||
} else if (option->type == xrm_Char) {
|
||||
if (p->type != P_CHAR) {
|
||||
*error = g_strdup_printf(
|
||||
|
@ -629,7 +626,7 @@ static gboolean __config_parser_set_property(XrmOption *option,
|
|||
return TRUE;
|
||||
}
|
||||
*(option->value.charc) = (p->value.c);
|
||||
option->source = CONFIG_FILE_THEME;
|
||||
option->source = (option->source & ~3) | CONFIG_FILE_THEME;
|
||||
} else {
|
||||
// TODO add type
|
||||
*error = g_strdup_printf("Option: %s is not of a supported type: %s.",
|
||||
|
@ -671,7 +668,6 @@ gboolean config_parse_set_property(const Property *p, char **error) {
|
|||
//*error = g_strdup_printf("Option: %s is not found.", p->name);
|
||||
g_warning("Option: %s is not found.", p->name);
|
||||
|
||||
|
||||
for (GList *iter = g_list_first(extra_parsed_options); iter != NULL;
|
||||
iter = g_list_next(iter)) {
|
||||
if (g_strcmp0(((Property *)(iter->data))->name, p->name) == 0) {
|
||||
|
@ -709,7 +705,7 @@ void config_xresource_free(void) {
|
|||
}
|
||||
|
||||
static void config_parse_dump_config_option(FILE *out, XrmOption *option) {
|
||||
if (option->type == xrm_Char || option->source == CONFIG_DEFAULT) {
|
||||
if (option->type == xrm_Char || (option->source & 3) == CONFIG_DEFAULT) {
|
||||
fprintf(out, "/*");
|
||||
}
|
||||
fprintf(out, "\t%s: ", option->name);
|
||||
|
@ -743,7 +739,7 @@ static void config_parse_dump_config_option(FILE *out, XrmOption *option) {
|
|||
}
|
||||
|
||||
fprintf(out, ";");
|
||||
if (option->type == xrm_Char || option->source == CONFIG_DEFAULT) {
|
||||
if (option->type == xrm_Char || (option->source & 3) == CONFIG_DEFAULT) {
|
||||
fprintf(out, "*/");
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
@ -760,12 +756,19 @@ void config_parse_dump_config_rasi_format(FILE *out, gboolean changes) {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (!changes || xrmOptions[i].source != CONFIG_DEFAULT) {
|
||||
if ((xrmOptions[i].source & CONFIG_NO_DISPLAY) == CONFIG_NO_DISPLAY) {
|
||||
continue;
|
||||
}
|
||||
if (!changes || (xrmOptions[i].source & 3) != CONFIG_DEFAULT) {
|
||||
config_parse_dump_config_option(out, &(xrmOptions[i]));
|
||||
}
|
||||
}
|
||||
for (unsigned int i = 0; i < num_extra_options; i++) {
|
||||
if (!changes || extra_options[i].source != CONFIG_DEFAULT) {
|
||||
if ((extra_options[i].source & CONFIG_NO_DISPLAY) == CONFIG_NO_DISPLAY) {
|
||||
continue;
|
||||
}
|
||||
if (!changes || (extra_options[i].source & 3) != CONFIG_DEFAULT) {
|
||||
|
||||
config_parse_dump_config_option(out, &(extra_options[i]));
|
||||
}
|
||||
}
|
||||
|
@ -776,6 +779,10 @@ void config_parse_dump_config_rasi_format(FILE *out, gboolean changes) {
|
|||
}
|
||||
|
||||
fprintf(out, "}\n");
|
||||
|
||||
if (config.theme != NULL) {
|
||||
fprintf(out, "@theme \"%s\"\r\n", config.theme);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_option_string(XrmOption *xo, int is_term) {
|
||||
|
@ -786,12 +793,12 @@ static void print_option_string(XrmOption *xo, int is_term) {
|
|||
printf("\t" color_italic "%s" color_reset,
|
||||
(*(xo->value.str) == NULL) ? "(unset)" : (*(xo->value.str)));
|
||||
printf(" " color_green "(%s)" color_reset "\n",
|
||||
ConfigSourceStr[xo->source]);
|
||||
ConfigSourceStr[xo->source & 3]);
|
||||
} else {
|
||||
printf("\t-%s [string]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment);
|
||||
printf("\t\t%s",
|
||||
(*(xo->value.str) == NULL) ? "(unset)" : (*(xo->value.str)));
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source]);
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source & 3]);
|
||||
}
|
||||
}
|
||||
static void print_option_number(XrmOption *xo, int is_term) {
|
||||
|
@ -801,11 +808,11 @@ static void print_option_number(XrmOption *xo, int is_term) {
|
|||
30 - l, ' ', xo->comment);
|
||||
printf("\t" color_italic "%u" color_reset, *(xo->value.num));
|
||||
printf(" " color_green "(%s)" color_reset "\n",
|
||||
ConfigSourceStr[xo->source]);
|
||||
ConfigSourceStr[xo->source & 3]);
|
||||
} else {
|
||||
printf("\t-%s [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment);
|
||||
printf("\t\t%u", *(xo->value.num));
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source]);
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source & 3]);
|
||||
}
|
||||
}
|
||||
static void print_option_snumber(XrmOption *xo, int is_term) {
|
||||
|
@ -815,11 +822,11 @@ static void print_option_snumber(XrmOption *xo, int is_term) {
|
|||
30 - l, ' ', xo->comment);
|
||||
printf("\t" color_italic "%d" color_reset, *(xo->value.snum));
|
||||
printf(" " color_green "(%s)" color_reset "\n",
|
||||
ConfigSourceStr[xo->source]);
|
||||
ConfigSourceStr[xo->source & 3]);
|
||||
} else {
|
||||
printf("\t-%s [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment);
|
||||
printf("\t\t%d", *(xo->value.snum));
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source]);
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source & 3]);
|
||||
}
|
||||
}
|
||||
static void print_option_char(XrmOption *xo, int is_term) {
|
||||
|
@ -829,11 +836,11 @@ static void print_option_char(XrmOption *xo, int is_term) {
|
|||
30 - l, ' ', xo->comment);
|
||||
printf("\t" color_italic "%c" color_reset, *(xo->value.charc));
|
||||
printf(" " color_green "(%s)" color_reset "\n",
|
||||
ConfigSourceStr[xo->source]);
|
||||
ConfigSourceStr[xo->source & 3]);
|
||||
} else {
|
||||
printf("\t-%s [character]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment);
|
||||
printf("\t\t%c", *(xo->value.charc));
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source]);
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source & 3]);
|
||||
}
|
||||
}
|
||||
static void print_option_boolean(XrmOption *xo, int is_term) {
|
||||
|
@ -844,15 +851,18 @@ static void print_option_boolean(XrmOption *xo, int is_term) {
|
|||
printf("\t" color_italic "%s" color_reset,
|
||||
(*(xo->value.snum)) ? "True" : "False");
|
||||
printf(" " color_green "(%s)" color_reset "\n",
|
||||
ConfigSourceStr[xo->source]);
|
||||
ConfigSourceStr[xo->source & 3]);
|
||||
} else {
|
||||
printf("\t-[no-]%s %-*c%s\n", xo->name, 33 - l, ' ', xo->comment);
|
||||
printf("\t\t%s", (*(xo->value.snum)) ? "True" : "False");
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source]);
|
||||
printf(" (%s)\n", ConfigSourceStr[xo->source & 3]);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_option(XrmOption *xo, int is_term) {
|
||||
if ((xo->source & CONFIG_NO_DISPLAY) == CONFIG_NO_DISPLAY) {
|
||||
return;
|
||||
}
|
||||
switch (xo->type) {
|
||||
case xrm_String:
|
||||
print_option_string(xo, is_term);
|
||||
|
|
Loading…
Add table
Reference in a new issue