[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk de7b0da 049/100: use pgtk_menu_set_in_use.
From: |
Yuuki Harano |
Subject: |
feature/pgtk de7b0da 049/100: use pgtk_menu_set_in_use. |
Date: |
Tue, 24 Nov 2020 08:02:35 -0500 (EST) |
branch: feature/pgtk
commit de7b0daf2b70648c968356036110cbe8c0c3188c
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
use pgtk_menu_set_in_use.
* ../src/pgtkfns.c:
(Fx_file_dialog, clean_up_dialog):
* src/pgtkmenu.c (pgtk_menu_wait_for_event):
---
src/pgtkfns.c | 13 +++++++++++--
src/pgtkmenu.c | 2 +-
src/pgtkterm.h | 3 +++
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 69a7430..b7d34d5 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -2916,6 +2916,12 @@ visible. */)
return Qnil;
}
+static void
+clean_up_dialog (void)
+{
+ pgtk_menu_set_in_use (false);
+}
+
DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
doc: /* Read file name, prompting with PROMPT in directory DIR.
Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
@@ -2940,14 +2946,17 @@ value of DIR as in previous invocations; this is
standard MS Windows behavior.
check_window_system (f);
+ if (popup_activated ())
+ error ("Trying to use a menu from within a menu-entry");
+ else
+ pgtk_menu_set_in_use (true);
+
CHECK_STRING (prompt);
CHECK_STRING (dir);
/* Prevent redisplay. */
specbind (Qinhibit_redisplay, Qt);
-#if 0
record_unwind_protect_void (clean_up_dialog);
-#endif
block_input ();
diff --git a/src/pgtkmenu.c b/src/pgtkmenu.c
index b946220..6f4195d 100644
--- a/src/pgtkmenu.c
+++ b/src/pgtkmenu.c
@@ -69,7 +69,7 @@ pgtk_menu_set_in_use (bool in_use)
/* Wait for an X event to arrive or for a timer to expire. */
-void
+static void
pgtk_menu_wait_for_event (void *data)
{
struct timespec next_time = timer_check (), *ntp;
diff --git a/src/pgtkterm.h b/src/pgtkterm.h
index 73e04b7..e740318 100644
--- a/src/pgtkterm.h
+++ b/src/pgtkterm.h
@@ -610,6 +610,9 @@ extern struct pgtk_display_info *check_pgtk_display_info
(Lisp_Object object);
extern void pgtk_default_font_parameter (struct frame *f, Lisp_Object parms);
+extern void pgtk_menu_set_in_use (bool in_use);
+
+
extern void pgtk_enqueue_string(struct frame *f, gchar *str);
extern void pgtk_enqueue_preedit(struct frame *f, Lisp_Object image_data);
extern void pgtk_im_focus_in(struct frame *f);
- feature/pgtk 3b161dd 066/100: * src/pgtkselect.h: Change coding style, (continued)
- feature/pgtk 3b161dd 066/100: * src/pgtkselect.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 89cbe37 070/100: * src/keyboard.c (make_lispy_event): Fix coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f6d8c59 001/100: Introduce Pure GTK3 port, Yuuki Harano, 2020/11/24
- feature/pgtk a9c8a56 006/100: Fix xdg-open handling, Yuuki Harano, 2020/11/24
- feature/pgtk ed1f7d1 008/100: Simplify compilaiton condtion, Yuuki Harano, 2020/11/24
- feature/pgtk cdc04b4 010/100: Implement menubar for pgtk emacs, Yuuki Harano, 2020/11/24
- feature/pgtk 85441c9 016/100: Add Stipple support for PGTK, Yuuki Harano, 2020/11/24
- feature/pgtk bfbcb11 026/100: implement set-tool-bar-position and set-sticky, Yuuki Harano, 2020/11/24
- feature/pgtk af5b725 061/100: * src/pgtkmenu.c: change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk e649275 058/100: * src/pgtkterm.c: change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk de7b0da 049/100: use pgtk_menu_set_in_use.,
Yuuki Harano <=
- feature/pgtk af1e279 073/100: Restore support for terminal only emacs in PGTK (add --with-pgtk), Yuuki Harano, 2020/11/24
- feature/pgtk 8669feb 054/100: Make icons and titles work like on X, Yuuki Harano, 2020/11/24
- feature/pgtk 20dbd4e 069/100: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 9e56fa9 034/100: Support focus on click event, Yuuki Harano, 2020/11/24
- feature/pgtk 385e85c 038/100: End Resize flickering by copying surface rather than just clearing, Yuuki Harano, 2020/11/24
- feature/pgtk cbd28cd 046/100: improve code readability., Yuuki Harano, 2020/11/24
- feature/pgtk ef67659 045/100: Set screen/display dpi res to make broadway work as expected, Yuuki Harano, 2020/11/24
- feature/pgtk d109dab 059/100: * src/pgtkfns.c: change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 9eb35f9 033/100: experimental support of tab-bar., Yuuki Harano, 2020/11/24
- feature/pgtk 25cf592 067/100: Change coding style, Yuuki Harano, 2020/11/24