Commit Graph

254 Commits

Author SHA1 Message Date
wdlkmpx 30929fe68d gtkcompletionline: set/unset prefix in generate_execs_list/dirlist() 2020-10-03 21:06:41 +08:00
wdlkmpx 2c254aad92 gtkcompletionline.c: properly sort completion list 2020-10-03 21:05:30 +08:00
wdlkmpx 496a0782b4 gtkcompletionline.c: fix segfault with gtk3
the gtk_list_store is used after it's been destroyed

on_cursor_changed was being triggered inappropriately
block the signal in destroy_completion_window()
2020-10-02 12:29:44 +08:00
wdlkmpx 53de437b97 gtkcompletionline: remove unused cl->first_key 2020-10-02 12:28:19 +08:00
wdlkmpx 70a9bde3f6 get_words(): add empty string if glist is empty
move hack from tab_pressed()
2020-10-02 12:28:09 +08:00
wdlkmpx 669f9094cc gtkcompletionline.c: fix memory leak in complete_from_list() 2020-10-02 12:28:03 +08:00
wdlkmpx aecb75916c tab_pressed(): don't call complete_line() if completion window exists 2020-10-02 12:27:52 +08:00
wdlkmpx b026cd6e04 gtkcompletionline.c: improve logic to free glists 2020-10-02 12:27:49 +08:00
wdlkmpx d794934169 merge generate_completion_from_execs/dirlist() into complete_line() 2020-10-02 12:27:06 +08:00
wdlkmpx 3727eb6d26 gtkcompletionline.c: avoid triggering on_cursor_changed() twice
this also potentially fixes some memory leaks
2020-10-02 12:27:04 +08:00
wdlkmpx 60b7bca318 gtkcompletionline.c: fix complete_from_list / set_words / complete_line 2020-10-02 12:27:00 +08:00
wdlkmpx c8bd0dec3e gtkcompletionline.c: remove complete_common()
not really needed
2020-10-02 12:26:48 +08:00
wdlkmpx d46e89b2cf gtkcompletionline.c: add debug code 2020-10-02 12:26:35 +08:00
wdlkmpx acb6881379 complete_line(): optimize a bit / fix some memory leaks 2020-10-02 12:26:04 +08:00
wdlkmpx 9b51f89c54 main.c: use spaces 2020-09-29 16:22:07 +08:00
wdlkmpx fe821ecd98 gtkcompletionline.c: use spaces 2020-09-29 16:22:05 +08:00
wdlkmpx e866c24c39 gtkcompletionline.c: don't use gtk_tree_model_sort_new_with_model() 2020-09-29 16:22:03 +08:00
wdlkmpx da57c5dcb9 configure.ac: enable many gcc warnings 2020-09-29 16:22:00 +08:00
wdlkmpx 4361172862 *** gmrun is now a C application *** 2020-09-29 16:21:57 +08:00
wdlkmpx 30b75bd447 *** gtkcompletionline.c: use C code ***
based on a set of patches by mazes-80
but it became a different thing in the end

need to identify and fix potential memory leaks
(many of them are already fixed)
2020-09-29 16:21:52 +08:00
wdlkmpx 7218498da6 add data/zmtrace.sh 2020-09-29 16:20:02 +08:00
wdlkmpx d1b718c086 fix build with ancient glib 2020-09-14 23:51:13 +08:00
wdlkmpx 7622a99196 option to use glib XDG handling (disabled by default)
based on a set of patches by mazes-80

.# use GLib XDG handling? (freedesktop specification)
USE_XDG = 0

=======================================================================
 if not using XDG, you can specify URL and file Handlers...
2020-09-14 23:51:12 +08:00
wdlkmpx 84df0cdecc ext_check/url_check: don't include handler in history entry 2020-09-14 23:51:10 +08:00
wdlkmpx 41c75d7610 main.cc: fix calls to config_get_int() 2020-09-14 23:51:08 +08:00
wdlkmpx 3762bfc1d4 completionline.cc: make CTRL-R work as intended.. 2020-09-13 23:58:41 +08:00
wdlkmpx ef6ffe8d80 completionline: remove handling of ctrl-e/g (what's this?) 2020-09-13 23:51:16 +08:00
wdlkmpx 2869dc0e23 history.c: improvements
- _history_write_to_file(): just write everything
- new HistoryFile.list_end: references the last item
- new HistoryFile.has_changed: flag to determine if the history has changed..
- do not allow duplicate entries
- option to save only if the history has changed
2020-09-13 23:51:04 +08:00
wdlkmpx b95c55899b main.cc: (history) show search text next to "Search:" label 2020-09-13 23:50:54 +08:00
wdlkmpx 7c73eb62ea completionline.cc: fix Pango-CRITICAL **: pango_layout_get_cursor_pos ...
GTK3: Pango-CRITICAL **: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed
-- for some reason there's an error when the object is destroyed
-- The GtkCompletionLine 'cancel' signal makes gmrun destroy the object and exit
-- The current fix is to set an empty text

Something must be causing the issue, a proper fix is yet to be found.
2020-09-13 00:16:55 +08:00
wdlkmpx 5bec03672d src/main.cc: get rid of 'struct gigi'
create two global variables
- wlabel
- wlabel_search

instead of using g->w1, g->w2
2020-09-13 00:16:50 +08:00
wdlkmpx 1a72b7c36c completion: (search) cl->hist_word is now a char array 2020-09-13 00:16:48 +08:00
wdlkmpx 05511520d9 *** handle configuration and history with C code ***
This is a major change that may lead to a complete C application.

Deleted files:
- prefs.cc
- prefs.h
- history.cc
- history.h

New files:
- config_prefs.c
- config_prefs.h
- history.c
- history.h

gmrun was mostly broken, I'm not sure when the app became so broken
but it's better now.

The code is more readable and more stable.

Various bugs were fixed, it would take many lines to explain the changes,
they were just so dramatic
2020-09-13 00:16:42 +08:00
wdlkmpx 1836e4a58f completion: TabTimeout: fix "Source ID was not found when attempting to remove it" 2020-09-09 00:03:14 +08:00
wdlkmpx 83cb7b7d85 new configuration option: Geometry
remove 'Left', 'Top', 'Width'

*# Set window geometry
*# - Wx      width                400x
*# - WxH     width x height       400x70         (height = 0 = ignore)
*# - WxH+x+y width x height +x +y 400x0+200+100
*#
*# If +x+y is not specified (or not allowed), the gmrun window is displayed centered
Geometry = 450x
2020-09-08 23:51:02 +08:00
wdlkmpx 92f184ac7e main.cc: gmrun_activate() / parse_command_line()
make main() as simple as possible
2020-09-08 21:44:37 +08:00
wdlkmpx b227610e0c main.cc: gmrun_exit() 2020-09-08 21:27:06 +08:00
wdlkmpx 42860f123a add gmrun.desktop / gmrun.png 2020-09-08 14:40:04 +08:00
wdlkmpx 4615a8701c gtk_completion_line_init: 'self' instead of 'object' 2020-09-07 23:20:31 +08:00
wdlkmpx ceff6dd2bd gtkcompletionline.cc: use G_DEFINE_TYPE_EXTENDED() 2020-09-07 21:47:47 +08:00
wdlkmpx f191713307 update gtkcompat.h
now a single-header lib (MIT)
2020-09-07 18:50:27 +08:00
wdlkmpx da1ec0d8fd remove src/main.h 2020-09-07 17:37:52 +08:00
wdlkmpx 997eb7480e window icon: use 'system-run' or 'gtk-execute' 2020-09-07 17:07:54 +08:00
wdlkmpx 67096ce9ae set_info_text_color: optimize a bit 2020-09-07 15:56:19 +08:00
wdlkmpx 3d3c2785ed run_the_command: use g_shell_parse_argv() and g_spawn_async() 2020-09-07 15:48:07 +08:00
wdlkmpx 37667213b0 use G_OBJECT with g_signal_* 2020-09-07 12:14:20 +08:00
wdlkmpx abb39e6d61 main.cc: gtk_widget_show_all (dialog) 2020-09-07 11:51:11 +08:00
wdlkmpx a93e3b8b08 main.cc: main_vbox 2020-09-07 11:51:10 +08:00
wdlkmpx 9097eba9f3 gtk_completion_line_class_init(): cosmetic changes 2020-09-07 11:51:10 +08:00
wdlkmpx 216c71d7fd completion: use gtk_tree_model_iter_n_children() to get row count 2020-09-07 11:51:10 +08:00