Renamed the flag when holding shift from run_in_term to mod_shift. This makes more sense as not all modes have a need for a run in term option

This commit is contained in:
Scoopta 2019-11-18 22:16:06 -08:00
parent 750cdd0167
commit a15390c685
3 changed files with 7 additions and 7 deletions

View File

@ -53,7 +53,7 @@ bool wofi_allow_images();
uint64_t wofi_get_image_size(); uint64_t wofi_get_image_size();
bool wofi_run_in_term(); bool wofi_mod_shift();
bool wofi_mod_control(); bool wofi_mod_control();

View File

@ -79,7 +79,7 @@ void wofi_run_init() {
} }
void wofi_run_exec(const gchar* cmd) { void wofi_run_exec(const gchar* cmd) {
if(wofi_run_in_term()) { if(wofi_mod_shift()) {
wofi_write_cache(MODE, cmd); wofi_write_cache(MODE, cmd);
wofi_term_run(cmd); wofi_term_run(cmd);
} }

View File

@ -31,7 +31,7 @@ static bool allow_images, allow_markup;
static uint64_t image_size; static uint64_t image_size;
static char* cache_file = NULL; static char* cache_file = NULL;
static char* config_dir; static char* config_dir;
static bool run_in_term; static bool mod_shift;
static bool mod_ctrl; static bool mod_ctrl;
static char* terminal; static char* terminal;
static GtkOrientation outer_orientation; static GtkOrientation outer_orientation;
@ -320,8 +320,8 @@ uint64_t wofi_get_image_size() {
return image_size; return image_size;
} }
bool wofi_run_in_term() { bool wofi_mod_shift() {
return run_in_term; return mod_shift;
} }
bool wofi_mod_control() { bool wofi_mod_control() {
@ -417,9 +417,9 @@ static gboolean key_press(GtkWidget* widget, GdkEvent* event, gpointer data) {
case GDK_KEY_Left: case GDK_KEY_Left:
break; break;
case GDK_KEY_Return: case GDK_KEY_Return:
run_in_term = (event->key.state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK; mod_shift = (event->key.state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK;
mod_ctrl = (event->key.state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK; mod_ctrl = (event->key.state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK;
if(run_in_term) { if(mod_shift) {
event->key.state &= ~GDK_SHIFT_MASK; event->key.state &= ~GDK_SHIFT_MASK;
} }
if(mod_ctrl) { if(mod_ctrl) {