From 03bd58e63d1032351b31aa5643026d91c2987239 Mon Sep 17 00:00:00 2001 From: Declan Tsien Date: Mon, 15 Apr 2024 03:52:24 +0800 Subject: [PATCH] Prevent use parent-frame parameter on winit for now --- crates/emacs-sys/src/frame.rs | 5 +++++ lisp/term/winit-win.el | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/crates/emacs-sys/src/frame.rs b/crates/emacs-sys/src/frame.rs index e97d403856c..d4bc003835c 100644 --- a/crates/emacs-sys/src/frame.rs +++ b/crates/emacs-sys/src/frame.rs @@ -522,6 +522,11 @@ impl FrameRef { }; f.set_parent(parent_frame); f.store_param(FrameParam::ParentFrame, parent_frame); + + if cfg!(have_winit) && parent_frame.is_not_nil() { + error!("Winit currently doesn't support parent-frame parameter"); + } + let unsplittable = f.is_minibuf_only() || dpyinfo.gui_arg(params, FrameParam::Unsplittable).is_t(); f.set_no_split(unsplittable); diff --git a/lisp/term/winit-win.el b/lisp/term/winit-win.el index fcdc9392ebc..5611c6a1acf 100644 --- a/lisp/term/winit-win.el +++ b/lisp/term/winit-win.el @@ -1284,6 +1284,16 @@ This returns an error if any Emacs frames are X frames." ;; Initiate drag and drop ;; TODO + +(defun child-frame-support-p () + "Winit currently doesn't support child frame." + nil) + +(eval-after-load 'posframe + (advice-add 'posframe-workable-p :override 'child-frame-support-p)) +(eval-after-load 'corfu + (advice-add 'corfu--popup-support-p :override 'child-frame-support-p)) + (provide 'winit-win) (provide 'term/winit-win)