* set-frame-parameter a child-frame's 'parent-frame error on macOS ? @ 2018-01-12 3:02 tumashu 2018-01-12 8:49 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: tumashu @ 2018-01-12 3:02 UTC (permalink / raw) To: emacs-devel@gnu.org [-- Attachment #1: Type: text/plain, Size: 4518 bytes --] The test code: ---------------- (let ((test (let ((after-make-frame-functions nil)) (make-frame `((parent-frame . ,(window-frame)) (width . 10) (height . 10)))))) (set-frame-parameter test 'parent-frame (window-frame))) ---------- The error: ------- Debugger entered--Lisp error: (error "Invalid specification of ‘parent-frame’") modify-frame-parameters(#<frame Emacs 0x114d8b960> ((parent-frame . #<frame *scratch* 0x106815a30>))) set-frame-parameter(#<frame Emacs 0x114d8b960> parent-frame #<frame *scratch* 0x106815a30>) (let ((test (let ((after-make-frame-functions nil)) (make-frame (cons (cons 'parent-frame (window-frame)) '((width . 10) (height . 10))))))) (set-frame-parameter test 'parent-frame (window-frame))) eval((let ((test (let ((after-make-frame-functions nil)) (make-frame (cons (cons 'parent-frame (window-frame)) '((width . 10) (height . 10))))))) (set-frame-parameter test 'parent-frame (window-frame))) nil) elisp--eval-last-sexp(nil) #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>)(nil) #f(compiled-function (&rest _it) #<bytecode 0x413d1275>)() eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>)) eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>)) esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>) #f(compiled-function (&rest args2) #<bytecode 0x45362dfd>)) ad-Advice-eval-last-sexp(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>) nil) apply(ad-Advice-eval-last-sexp #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>) nil) eval-last-sexp(nil) eros-eval-last-sexp(nil) funcall-interactively(eros-eval-last-sexp nil) call-interactively(eros-eval-last-sexp nil nil) command-execute(eros-eval-last-sexp) ------- [-- Attachment #2: Type: text/html, Size: 4903 bytes --] ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 3:02 set-frame-parameter a child-frame's 'parent-frame error on macOS ? tumashu @ 2018-01-12 8:49 ` martin rudalics 2018-01-12 12:13 ` Feng Shu 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-12 8:49 UTC (permalink / raw) To: tumashu, emacs-devel@gnu.org, Alan Third > The test code: > > ---------------- > (let ((test (let ((after-make-frame-functions nil)) > (make-frame > `((parent-frame . ,(window-frame)) > (width . 10) > (height . 10)))))) > (set-frame-parameter test 'parent-frame (window-frame))) > ---------- I'm not sure what this code is supposed to do. First you make a new child frame named 'test' with the selected frame as its parent. Then you want to set the parent frame of 'test' to the selected frame. But I'm afraid that the implementation of x_set_parent_frame in nsterm.m has a bug which I didn't notice before. It uses FRAME_X_P although it probably should use FRAME_NS_P. And this > Debugger entered--Lisp error: (error "Invalid specification of ‘parent-frame’") > modify-frame-parameters(#<frame Emacs 0x114d8b960> ((parent-frame . #<frame *scratch* 0x106815a30>))) > set-frame-parameter(#<frame Emacs 0x114d8b960> parent-frame #<frame *scratch* 0x106815a30>) > (let ((test (let ((after-make-frame-functions nil)) (make-frame (cons (cons 'parent-frame (window-frame)) '((width . 10) (height . 10))))))) (set-frame-parameter test 'parent-frame (window-frame))) > eval((let ((test (let ((after-make-frame-functions nil)) (make-frame (cons (cons 'parent-frame (window-frame)) '((width . 10) (height . 10))))))) (set-frame-parameter test 'parent-frame (window-frame))) nil) > elisp--eval-last-sexp(nil) > #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>)(nil) > #f(compiled-function (&rest _it) #<bytecode 0x413d1275>)() > eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>)) > eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>)) > esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode 0x45362ddd>) #f(compiled-function (&rest args2) #<bytecode 0x45362dfd>)) > ad-Advice-eval-last-sexp(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>) nil) > apply(ad-Advice-eval-last-sexp #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d4227>) nil) > eval-last-sexp(nil) > eros-eval-last-sexp(nil) > funcall-interactively(eros-eval-last-sexp nil) > call-interactively(eros-eval-last-sexp nil nil) > command-execute(eros-eval-last-sexp) looks very similar to Bug#30019's Debugger entered--Lisp error: (error "Invalid specification of ‘parent-frame’") modify-frame-parameters(#<frame Emacs 0x11571e7d0> ((parent-frame . #<frame *Warnings* 0x10982e5b0>))) set-frame-parameter(#<frame Emacs 0x11571e7d0> parent-frame #<frame *Warnings* 0x10982e5b0>) Alan, please have a look. Thanks, martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 8:49 ` martin rudalics @ 2018-01-12 12:13 ` Feng Shu 2018-01-12 18:47 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-12 12:13 UTC (permalink / raw) To: martin rudalics; +Cc: Feng Shu, emacs-devel martin rudalics <rudalics@gmx.at> writes: >> The test code: >> >> ---------------- >> (let ((test (let ((after-make-frame-functions nil)) >> (make-frame >> `((parent-frame . ,(window-frame)) >> (width . 10) >> (height . 10)))))) >> (set-frame-parameter test 'parent-frame (window-frame))) >> ---------- > > I'm not sure what this code is supposed to do. First you make a new > child frame named 'test' with the selected frame as its parent. Then > you want to set the parent frame of 'test' to the selected frame. > The above just a example to show bug. I want to use child-frame as popup menu of company. so I want reuse exist child-frame instead of recreate a new one. for the speed. when I switch to other frame, child-frame's parent-frame must be reseted. > But I'm afraid that the implementation of x_set_parent_frame in > nsterm.m has a bug which I didn't notice before. It uses FRAME_X_P > although it probably should use FRAME_NS_P. And this > >> Debugger entered--Lisp error: (error "Invalid specification of ‘parent-frame’") >> modify-frame-parameters(#<frame Emacs 0x114d8b960> ((parent-frame . #<frame *scratch* 0x106815a30>))) >> set-frame-parameter(#<frame Emacs 0x114d8b960> parent-frame #<frame *scratch* 0x106815a30>) >> (let ((test (let ((after-make-frame-functions nil)) (make-frame >> (cons (cons 'parent-frame (window-frame)) '((width . 10) (height >> . 10))))))) (set-frame-parameter test 'parent-frame (window-frame))) >> eval((let ((test (let ((after-make-frame-functions nil)) >> (make-frame (cons (cons 'parent-frame (window-frame)) '((width . 10) >> (height . 10))))))) (set-frame-parameter test 'parent-frame >> (window-frame))) nil) >> elisp--eval-last-sexp(nil) >> #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp >> before point; print value in the echo area.\nInteractively, with a >> non `-' prefix argument, print output into\ncurrent >> buffer.\n\nNormally, this function truncates long output according >> to the\nvalue of the variables `eval-expression-print-length' >> and\n`eval-expression-print-level'. With a prefix argument of >> zero,\nhowever, there is no such truncation. Such a prefix >> argument\nalso causes integers to be printed in several additional >> formats\n(octal, hexadecimal, and character when the prefix argument >> is\n-1 or the integer is `eval-expression-print-maximum-character' >> or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which >> is the default,\nthis command arranges for all errors to enter the >> debugger." (interactive "P") #<bytecode 0x400d4227>)(nil) >> #f(compiled-function (&rest _it) #<bytecode 0x413d1275>)() >> eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) >> #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) >> #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) >> #<bytecode 0x45362ddd>)) >> eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) >> #<bytecode 0x413d1275>) #f(compiled-function (&rest args2) >> #<bytecode 0x45362dbd>) #f(compiled-function (&rest args2) >> #<bytecode 0x45362ddd>)) >> esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode >> 0x413d1275>) #f(compiled-function (&rest args2) #<bytecode >> 0x45362dbd>) #f(compiled-function (&rest args2) #<bytecode >> 0x45362ddd>) #f(compiled-function (&rest args2) #<bytecode >> 0x45362dfd>)) >> ad-Advice-eval-last-sexp(#f(compiled-function >> (eval-last-sexp-arg-internal) "Evaluate sexp before point; print >> value in the echo area.\nInteractively, with a non `-' prefix >> argument, print output into\ncurrent buffer.\n\nNormally, this >> function truncates long output according to the\nvalue of the >> variables `eval-expression-print-length' >> and\n`eval-expression-print-level'. With a prefix argument of >> zero,\nhowever, there is no such truncation. Such a prefix >> argument\nalso causes integers to be printed in several additional >> formats\n(octal, hexadecimal, and character when the prefix argument >> is\n-1 or the integer is `eval-expression-print-maximum-character' >> or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which >> is the default,\nthis command arranges for all errors to enter the >> debugger." (interactive "P") #<bytecode 0x400d4227>) nil) >> apply(ad-Advice-eval-last-sexp #f(compiled-function >> (eval-last-sexp-arg-internal) "Evaluate sexp before point; print >> value in the echo area.\nInteractively, with a non `-' prefix >> argument, print output into\ncurrent buffer.\n\nNormally, this >> function truncates long output according to the\nvalue of the >> variables `eval-expression-print-length' >> and\n`eval-expression-print-level'. With a prefix argument of >> zero,\nhowever, there is no such truncation. Such a prefix >> argument\nalso causes integers to be printed in several additional >> formats\n(octal, hexadecimal, and character when the prefix argument >> is\n-1 or the integer is `eval-expression-print-maximum-character' >> or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which >> is the default,\nthis command arranges for all errors to enter the >> debugger." (interactive "P") #<bytecode 0x400d4227>) nil) >> eval-last-sexp(nil) >> eros-eval-last-sexp(nil) >> funcall-interactively(eros-eval-last-sexp nil) >> call-interactively(eros-eval-last-sexp nil nil) >> command-execute(eros-eval-last-sexp) > > looks very similar to Bug#30019's > > Debugger entered--Lisp error: (error "Invalid specification of ‘parent-frame’") > modify-frame-parameters(#<frame Emacs 0x11571e7d0> ((parent-frame . > #<frame *Warnings* 0x10982e5b0>))) > set-frame-parameter(#<frame Emacs 0x11571e7d0> parent-frame #<frame > *Warnings* 0x10982e5b0>) > > Alan, please have a look. > > Thanks, martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 12:13 ` Feng Shu @ 2018-01-12 18:47 ` martin rudalics 2018-01-12 19:31 ` Alan Third 2018-01-13 3:01 ` tumashu 0 siblings, 2 replies; 48+ messages in thread From: martin rudalics @ 2018-01-12 18:47 UTC (permalink / raw) To: Feng Shu; +Cc: emacs-devel >>> (let ((test (let ((after-make-frame-functions nil)) >>> (make-frame >>> `((parent-frame . ,(window-frame)) >>> (width . 10) >>> (height . 10)))))) >>> (set-frame-parameter test 'parent-frame (window-frame))) >>> ---------- >> >> I'm not sure what this code is supposed to do. First you make a new >> child frame named 'test' with the selected frame as its parent. Then >> you want to set the parent frame of 'test' to the selected frame. >> > > The above just a example to show bug. OK. But setting the parent frame two times for the same frame makes it difficult to say which instance causes the bug. Anyway, can you try the trivial patch to nsterm.m below? Thanks, martin diff --git a/src/nsterm.m b/src/nsterm.m index 5798f4f..1a6066f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1932,7 +1932,7 @@ so some key presses (TAB) are swallowed by the system. */ if (!NILP (new_value) && (!FRAMEP (new_value) || !FRAME_LIVE_P (p = XFRAME (new_value)) - || !FRAME_X_P (p))) + || !FRAME_NS_P (p))) { store_frame_param (f, Qparent_frame, old_value); error ("Invalid specification of `parent-frame'"); ^ permalink raw reply related [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 18:47 ` martin rudalics @ 2018-01-12 19:31 ` Alan Third 2018-01-13 8:49 ` martin rudalics 2018-01-13 3:01 ` tumashu 1 sibling, 1 reply; 48+ messages in thread From: Alan Third @ 2018-01-12 19:31 UTC (permalink / raw) To: martin rudalics; +Cc: Feng Shu, emacs-devel On Fri, Jan 12, 2018 at 07:47:53PM +0100, martin rudalics wrote: > >>> (let ((test (let ((after-make-frame-functions nil)) > >>> (make-frame > >>> `((parent-frame . ,(window-frame)) > >>> (width . 10) > >>> (height . 10)))))) > >>> (set-frame-parameter test 'parent-frame (window-frame))) > >>> ---------- > >> > >> I'm not sure what this code is supposed to do. First you make a new > >> child frame named 'test' with the selected frame as its parent. Then > >> you want to set the parent frame of 'test' to the selected frame. > >> > > > > The above just a example to show bug. > > OK. But setting the parent frame two times for the same frame makes > it difficult to say which instance causes the bug. Anyway, can you > try the trivial patch to nsterm.m below? The patch gets rid of the error message for me. Perhaps it will also fix bug#30019. -- Alan Third ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 19:31 ` Alan Third @ 2018-01-13 8:49 ` martin rudalics 0 siblings, 0 replies; 48+ messages in thread From: martin rudalics @ 2018-01-13 8:49 UTC (permalink / raw) To: Alan Third; +Cc: Feng Shu, emacs-devel > The patch gets rid of the error message for me. Perhaps it will also > fix bug#30019. Thanks for checking. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re:Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-12 18:47 ` martin rudalics 2018-01-12 19:31 ` Alan Third @ 2018-01-13 3:01 ` tumashu 2018-01-13 8:50 ` martin rudalics 1 sibling, 1 reply; 48+ messages in thread From: tumashu @ 2018-01-13 3:01 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org [-- Attachment #1: Type: text/plain, Size: 1463 bytes --] Seem to fix the problem, thanks, https://github.com/tumashu/company-childframe/issues/3#issuecomment-357404832 At 2018-01-13 02:47:53, "martin rudalics" <rudalics@gmx.at> wrote: > >>> (let ((test (let ((after-make-frame-functions nil)) > >>> (make-frame > >>> `((parent-frame . ,(window-frame)) > >>> (width . 10) > >>> (height . 10)))))) > >>> (set-frame-parameter test 'parent-frame (window-frame))) > >>> ---------- > >> > >> I'm not sure what this code is supposed to do. First you make a new > >> child frame named 'test' with the selected frame as its parent. Then > >> you want to set the parent frame of 'test' to the selected frame. > >> > > > > The above just a example to show bug. > >OK. But setting the parent frame two times for the same frame makes >it difficult to say which instance causes the bug. Anyway, can you >try the trivial patch to nsterm.m below? > >Thanks, martin > > >diff --git a/src/nsterm.m b/src/nsterm.m >index 5798f4f..1a6066f 100644 >--- a/src/nsterm.m >+++ b/src/nsterm.m >@@ -1932,7 +1932,7 @@ so some key presses (TAB) are swallowed by the system. */ > if (!NILP (new_value) > && (!FRAMEP (new_value) > || !FRAME_LIVE_P (p = XFRAME (new_value)) >- || !FRAME_X_P (p))) >+ || !FRAME_NS_P (p))) > { > store_frame_param (f, Qparent_frame, old_value); > error ("Invalid specification of `parent-frame'"); > [-- Attachment #2: Type: text/html, Size: 1871 bytes --] ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 3:01 ` tumashu @ 2018-01-13 8:50 ` martin rudalics 2018-01-13 10:36 ` Feng Shu 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-13 8:50 UTC (permalink / raw) To: tumashu; +Cc: emacs-devel@gnu.org > Seem to fix the problem, thanks, https://github.com/tumashu/company-childframe/issues/3#issuecomment-357404832 Checked in on the release branch. Thanks for the test case. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 8:50 ` martin rudalics @ 2018-01-13 10:36 ` Feng Shu 2018-01-13 11:58 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-13 10:36 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org martin rudalics <rudalics@gmx.at> writes: >> Seem to fix the problem, thanks, https://github.com/tumashu/company-childframe/issues/3#issuecomment-357404832 > > Checked in on the release branch. Thanks for the test case. > > martin > Thanks! by the way, for this issue: https://github.com/tumashu/company-childframe/issues/2 I have tested many times, but can not find the reason. Do you suggest where I should first find? 1. Child-frame 2. HiDPI 3. Window manager 4. Other -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 10:36 ` Feng Shu @ 2018-01-13 11:58 ` martin rudalics 2018-01-13 12:11 ` Dmitry Gutov ` (2 more replies) 0 siblings, 3 replies; 48+ messages in thread From: martin rudalics @ 2018-01-13 11:58 UTC (permalink / raw) To: Feng Shu; +Cc: emacs-devel@gnu.org > by the way, for this issue: https://github.com/tumashu/company-childframe/issues/2 > > I have tested many times, but can not find the reason. > > Do you suggest where I should first find? > > 1. Child-frame > 2. HiDPI > 3. Window manager > 4. Other I don't understand the issue and not even whether it occurs with MacOS or Unity. Can you tell me more? martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 11:58 ` martin rudalics @ 2018-01-13 12:11 ` Dmitry Gutov 2018-01-13 12:29 ` martin rudalics 2018-01-13 23:57 ` Feng Shu 2018-01-13 23:59 ` Feng Shu 2 siblings, 1 reply; 48+ messages in thread From: Dmitry Gutov @ 2018-01-13 12:11 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/13/18 2:58 PM, martin rudalics wrote: > I don't understand the issue and not even whether it occurs with MacOS > or Unity. Can you tell me more? Unity, Ubuntu 17.04. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 12:11 ` Dmitry Gutov @ 2018-01-13 12:29 ` martin rudalics 2018-01-14 1:07 ` Dmitry Gutov 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-13 12:29 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org > Unity, Ubuntu 17.04. And what is the issue? That link https://send.firefox.com/download/793d8dab0f/#ziyoHhB0usYUs4mBCp5Q0w "has expired or never existed in the first place!" martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 12:29 ` martin rudalics @ 2018-01-14 1:07 ` Dmitry Gutov 2018-01-14 9:05 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Dmitry Gutov @ 2018-01-14 1:07 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/13/18 3:29 PM, martin rudalics wrote: > > Unity, Ubuntu 17.04. > > And what is the issue? That link > > https://send.firefox.com/download/793d8dab0f/#ziyoHhB0usYUs4mBCp5Q0w > > "has expired or never existed in the first place!" Here's that video: https://youtu.be/wU044PoC4pA?t=30 Guess that's the place I'm going to publish screencasts to from now on. :) ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 1:07 ` Dmitry Gutov @ 2018-01-14 9:05 ` martin rudalics 2018-01-14 10:34 ` Dmitry Gutov 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-14 9:05 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org > Here's that video: https://youtu.be/wU044PoC4pA?t=30 > > Guess that's the place I'm going to publish screencasts to from now on. :) Sorry. Neither VLC nor Firefox are capable here to show that video satisfactorily. After playing it three times I was able to see the menu once for a short moment only. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 9:05 ` martin rudalics @ 2018-01-14 10:34 ` Dmitry Gutov 2018-01-14 11:19 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Dmitry Gutov @ 2018-01-14 10:34 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/14/18 12:05 PM, martin rudalics wrote: > Sorry. Neither VLC nor Firefox are capable here to show that video > satisfactorily. Really? I'm using Firefox, on GNU/Linux. And it plays back fine. I can send it to you personally (the original mkv) if you like. > After playing it three times I was able to see the > menu once for a short moment only. Yeah, weird. I open it 3 times there. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 10:34 ` Dmitry Gutov @ 2018-01-14 11:19 ` martin rudalics 0 siblings, 0 replies; 48+ messages in thread From: martin rudalics @ 2018-01-14 11:19 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org > Really? I'm using Firefox, on GNU/Linux. And it plays back fine. I can send it to you personally (the original mkv) if you like. Please send me the mkv. Thanks, martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 11:58 ` martin rudalics 2018-01-13 12:11 ` Dmitry Gutov @ 2018-01-13 23:57 ` Feng Shu 2018-01-14 9:05 ` martin rudalics 2018-01-13 23:59 ` Feng Shu 2 siblings, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-13 23:57 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org martin rudalics <rudalics@gmx.at> writes: >> by the way, for this issue: https://github.com/tumashu/company-childframe/issues/2> >> I have tested many times, but can not find the reason. >> >> Do you suggest where I should first find? >> >> 1. Child-frame >> 2. HiDPI >> 3. Window manager >> 4. Other > > I don't understand the issue and not even whether it occurs with MacOS > or Unity. Can you tell me more? It's not my machine's issue, it is like this: when I want to show company-child-frame-menu at <position>, I support this position is (20, 50), but before show menu about 0.1s, this menu will be showed at positon (10, 25), and dispear and then show at position (20, 50), this is so fast, let menu look flicker. > > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 23:57 ` Feng Shu @ 2018-01-14 9:05 ` martin rudalics 2018-01-14 10:35 ` Dmitry Gutov 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-14 9:05 UTC (permalink / raw) To: Feng Shu; +Cc: emacs-devel@gnu.org > when I want to show company-child-frame-menu at <position>, I support > this position is (20, 50), but before show menu about 0.1s, this menu will be showed > at positon (10, 25), and dispear and then show at position (20, 50), > this is so fast, let menu look flicker. Does that happen with Robert Pluim's `set-frame-position' scaling patch? martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 9:05 ` martin rudalics @ 2018-01-14 10:35 ` Dmitry Gutov 2018-01-14 11:19 ` martin rudalics 2018-01-15 0:29 ` Dmitry Gutov 0 siblings, 2 replies; 48+ messages in thread From: Dmitry Gutov @ 2018-01-14 10:35 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/14/18 12:05 PM, martin rudalics wrote: > Does that happen with Robert Pluim's `set-frame-position' scaling > patch? Yes. Without it, both positions were far from point. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 10:35 ` Dmitry Gutov @ 2018-01-14 11:19 ` martin rudalics 2018-01-15 0:29 ` Dmitry Gutov 1 sibling, 0 replies; 48+ messages in thread From: martin rudalics @ 2018-01-14 11:19 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org > Yes. Without it, both positions were far from point. Any idea whether the code asks twice to position the frame? `set-frame-position' is generally a bad idea when creating a new frame. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-14 10:35 ` Dmitry Gutov 2018-01-14 11:19 ` martin rudalics @ 2018-01-15 0:29 ` Dmitry Gutov 2018-01-15 8:49 ` Robert Pluim 2018-01-15 9:38 ` martin rudalics 1 sibling, 2 replies; 48+ messages in thread From: Dmitry Gutov @ 2018-01-15 0:29 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/14/18 1:35 PM, Dmitry Gutov wrote: > On 1/14/18 12:05 PM, martin rudalics wrote: > >> Does that happen with Robert Pluim's `set-frame-position' scaling >> patch? > > Yes. Without it, both positions were far from point. Correction: without that patch, the first (momentary) position is where the popup should be, and the second one is at 2x the necessary vertical coordinate. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 0:29 ` Dmitry Gutov @ 2018-01-15 8:49 ` Robert Pluim 2018-01-15 9:38 ` martin rudalics 1 sibling, 0 replies; 48+ messages in thread From: Robert Pluim @ 2018-01-15 8:49 UTC (permalink / raw) To: Dmitry Gutov; +Cc: martin rudalics, emacs-devel@gnu.org, Feng Shu Dmitry Gutov <dgutov@yandex.ru> writes: > On 1/14/18 1:35 PM, Dmitry Gutov wrote: >> On 1/14/18 12:05 PM, martin rudalics wrote: >> >>> Does that happen with Robert Pluim's `set-frame-position' scaling >>> patch? >> >> Yes. Without it, both positions were far from point. > > Correction: without that patch, the first (momentary) position is > where the popup should be, and the second one is at 2x the necessary > vertical coordinate. Which means there's another spot that needs scaling applied, which I suspected because of desktop-restore issues I'm seeing, but I haven't found the right place yet. Robert ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 0:29 ` Dmitry Gutov 2018-01-15 8:49 ` Robert Pluim @ 2018-01-15 9:38 ` martin rudalics 2018-01-15 11:59 ` Feng Shu 2018-01-15 17:07 ` Dmitry Gutov 1 sibling, 2 replies; 48+ messages in thread From: martin rudalics @ 2018-01-15 9:38 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org Still not much luck with the video. I'm told that my video driver accelerators do not support the resolution 1854x2110 so they are deactivated. The result is that I see all sorts of artefacts. Anyway, it seems that the "good" frame appears around 00:34 and its "bad" double around 00:35 of the video. Is that correct? If so, please post simple screencaps with the corresponding timings. And also please resolve the discrepancy with what Feng Shu says here: when I want to show company-child-frame-menu at <position>, I support this position is (20, 50), but before show menu about 0.1s, this menu will be showed at positon (10, 25), and dispear and then show at position (20, 50), this is so fast, let menu look flicker. namely that the bad frame appears first. > Correction: without that patch, the first (momentary) position is > where the popup should be, and the second one is at 2x the necessary > vertical coordinate. Yet another hint that someone tries to position the frame twice. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 9:38 ` martin rudalics @ 2018-01-15 11:59 ` Feng Shu 2018-01-16 9:08 ` martin rudalics 2018-01-15 17:07 ` Dmitry Gutov 1 sibling, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-15 11:59 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org, Dmitry Gutov martin rudalics <rudalics@gmx.at> writes: > Still not much luck with the video. I'm told that my video driver > accelerators do not support the resolution 1854x2110 so they are > deactivated. The result is that I see all sorts of artefacts. > > Anyway, it seems that the "good" frame appears around 00:34 and its > "bad" double around 00:35 of the video. Is that correct? If so, > please post simple screencaps with the corresponding timings. And > also please resolve the discrepancy with what Feng Shu says here: > > when I want to show company-child-frame-menu at <position>, I support > this position is (20, 50), but before show menu about 0.1s, this menu will be showed > at positon (10, 25), and dispear and then show at position (20, 50), > this is so fast, let menu look flicker. > > namely that the bad frame appears first. > >> Correction: without that patch, the first (momentary) position is >> where the popup should be, and the second one is at 2x the necessary >> vertical coordinate. > > Yet another hint that someone tries to position the frame twice. The problem seem to be resolved when I update company-childframe. The change is that let set-frame-position run when needed instead every time. Dmitry Gutov's machine can work well without DiDPI patch :-) Are there bug when run multi set-frame-position on the same position? I do not know, and are testing. https://github.com/tumashu/company-childframe/issues/2 > > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 11:59 ` Feng Shu @ 2018-01-16 9:08 ` martin rudalics 2018-01-16 10:33 ` Feng Shu 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-16 9:08 UTC (permalink / raw) To: Feng Shu; +Cc: Dmitry Gutov, emacs-devel@gnu.org > Are there bug when run multi set-frame-position on the > same position? I do not know, and are testing. I have no idea. To my knowledge, any additional positioning request means asking for trouble. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-16 9:08 ` martin rudalics @ 2018-01-16 10:33 ` Feng Shu 2018-01-19 18:54 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-16 10:33 UTC (permalink / raw) To: martin rudalics; +Cc: Dmitry Gutov, emacs-devel@gnu.org martin rudalics <rudalics@gmx.at> writes: >> Are there bug when run multi set-frame-position on the >> same position? I do not know, and are testing. > > I have no idea. To my knowledge, any additional positioning request > means asking for trouble. It is a bad news, for company menu, recreating child-frame is toooo slow and flicker,so positioning an existing child-frame is *must* needed. The good news is that there be less *trouble* we faced at the moment :-) company-childframe works very well now :-) Thanks again for your help. > > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-16 10:33 ` Feng Shu @ 2018-01-19 18:54 ` martin rudalics 2018-01-20 0:11 ` Feng Shu 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-19 18:54 UTC (permalink / raw) To: Feng Shu; +Cc: emacs-devel@gnu.org, Dmitry Gutov > It is a bad news, for company menu, recreating child-frame is toooo slow > and flicker,so positioning an existing child-frame is *must* needed. Does "existing" mean a temporarily invisible child-frame? martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-19 18:54 ` martin rudalics @ 2018-01-20 0:11 ` Feng Shu 2018-01-20 10:34 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Feng Shu @ 2018-01-20 0:11 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org, Dmitry Gutov martin rudalics <rudalics@gmx.at> writes: >> It is a bad news, for company menu, recreating child-frame is toooo slow >> and flicker,so positioning an existing child-frame is *must* needed. > > Does "existing" mean a temporarily invisible child-frame? when first complete, company-childframe will create a invisible child-frame, posit this invisible child-frame, and make it visible. but after this, company-childframe just posit visible child-frame to next position. so sometime need posit invisible child-frame, sometimes need posit visible child-frame :-) > > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-20 0:11 ` Feng Shu @ 2018-01-20 10:34 ` martin rudalics 2018-01-20 13:26 ` Feng Shu 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-20 10:34 UTC (permalink / raw) To: Feng Shu; +Cc: Dmitry Gutov, emacs-devel@gnu.org > but after this, company-childframe just posit visible > child-frame to next position. And when the user is done with completion - does the child-frame become invisible or is it deleted? martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-20 10:34 ` martin rudalics @ 2018-01-20 13:26 ` Feng Shu 0 siblings, 0 replies; 48+ messages in thread From: Feng Shu @ 2018-01-20 13:26 UTC (permalink / raw) To: martin rudalics; +Cc: Dmitry Gutov, emacs-devel@gnu.org martin rudalics <rudalics@gmx.at> writes: >> but after this, company-childframe just posit visible >> child-frame to next position. > > And when the user is done with completion - does the child-frame > become invisible or is it deleted? invisible > > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 9:38 ` martin rudalics 2018-01-15 11:59 ` Feng Shu @ 2018-01-15 17:07 ` Dmitry Gutov 2018-01-16 9:07 ` martin rudalics 2018-01-16 11:10 ` Robert Pluim 1 sibling, 2 replies; 48+ messages in thread From: Dmitry Gutov @ 2018-01-15 17:07 UTC (permalink / raw) To: martin rudalics, Feng Shu; +Cc: emacs-devel@gnu.org On 1/15/18 12:38 PM, martin rudalics wrote: > Still not much luck with the video. I'm told that my video driver > accelerators do not support the resolution 1854x2110 so they are > deactivated. The result is that I see all sorts of artefacts. Might software rendering work, then? The way to use it depends on the video player, etc. > Anyway, it seems that the "good" frame appears around 00:34 and its > "bad" double around 00:35 of the video. Is that correct? If so, > please post simple screencaps with the corresponding timings. I've sent a scaled-down video, hopefully it works. Not sure what you are looking for on the screenshots, though. I can try describing them with text. > And > also please resolve the discrepancy with what Feng Shu says here: > > when I want to show company-child-frame-menu at <position>, I support > this position is (20, 50), but before show menu about 0.1s, this menu > will be showed > at positon (10, 25), and dispear and then show at position (20, 50), > this is so fast, let menu look flicker. > > namely that the bad frame appears first. That is the description of my experience with Robert's patch applied. Without it applied, the "bad frame" appears last (at position 40-100, approximately). Feng Shu has changed his code since to call set-frame-position much less often, and it seems to work correctly *without* Robert's patch. Quite weird. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 17:07 ` Dmitry Gutov @ 2018-01-16 9:07 ` martin rudalics 2018-01-16 10:37 ` Feng Shu 2018-01-16 11:10 ` Robert Pluim 1 sibling, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-16 9:07 UTC (permalink / raw) To: Dmitry Gutov, Feng Shu; +Cc: emacs-devel@gnu.org > Might software rendering work, then? The way to use it depends on the video player, etc. I'm afraid that video formats are not suitable to visualize ephemeral effects that show only for one or a few keyframes. > Feng Shu has changed his code since to call set-frame-position much > less often, and it seems to work correctly *without* Robert's > patch. I recall having had a discussion with someone who insisted on using `set-frame-position' immediately after making a new frame with the argument that it always used to work. In my experience this may confuse the hell out of the window manager and even if it does work for years it may cease to do so after an update of your system. As a rule, I try to position a frame initially only via parameters passed to `make-frame'. > Quite weird. Basically, positioning and sizing child frames work like positioning and sizing the scroll bar or tool bar windows. If scaling is needed for the latter, it is probably also needed for child frames. martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-16 9:07 ` martin rudalics @ 2018-01-16 10:37 ` Feng Shu 0 siblings, 0 replies; 48+ messages in thread From: Feng Shu @ 2018-01-16 10:37 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org, Dmitry Gutov > I recall having had a discussion with someone who insisted on using > `set-frame-position' immediately after making a new frame with the > argument that it always used to work. In my experience this may > confuse the hell out of the window manager and even if it does work > for years it may cease to do so after an update of your system. As a > rule, I try to position a frame initially only via parameters passed > to `make-frame'. company-childframe only need positioning an existing child-frame, not need "immediately positioning a frame after it is created." -- ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-15 17:07 ` Dmitry Gutov 2018-01-16 9:07 ` martin rudalics @ 2018-01-16 11:10 ` Robert Pluim 2018-01-22 11:11 ` Robert Pluim 1 sibling, 1 reply; 48+ messages in thread From: Robert Pluim @ 2018-01-16 11:10 UTC (permalink / raw) To: Dmitry Gutov; +Cc: martin rudalics, emacs-devel@gnu.org, Feng Shu Dmitry Gutov <dgutov@yandex.ru> writes: > That is the description of my experience with Robert's patch > applied. Without it applied, the "bad frame" appears last (at position > 40-100, approximately). > > Feng Shu has changed his code since to call set-frame-position much > less often, and it seems to work correctly *without* Robert's > patch. Quite weird. Yes. I have an improved version of the patch on the way, which should also fix `frameset-restore' and a few other cases of incorrect frame positioning. Hopefully by the end of the week. Robert ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-16 11:10 ` Robert Pluim @ 2018-01-22 11:11 ` Robert Pluim 2018-01-22 16:01 ` Eli Zaretskii 0 siblings, 1 reply; 48+ messages in thread From: Robert Pluim @ 2018-01-22 11:11 UTC (permalink / raw) To: Dmitry Gutov; +Cc: martin rudalics, emacs-devel, Feng Shu [-- Attachment #1: Type: text/plain, Size: 1050 bytes --] Robert Pluim <rpluim@gmail.com> writes: > Dmitry Gutov <dgutov@yandex.ru> writes: > >> That is the description of my experience with Robert's patch >> applied. Without it applied, the "bad frame" appears last (at position >> 40-100, approximately). >> >> Feng Shu has changed his code since to call set-frame-position much >> less often, and it seems to work correctly *without* Robert's >> patch. Quite weird. > > Yes. I have an improved version of the patch on the way, which should > also fix `frameset-restore' and a few other cases of incorrect frame > positioning. Hopefully by the end of the week. frameset-restore turned out to be a completely separate fix. The attached fixes the cases that I could track down where we weren't applying scaling properly. All Emacs pixel coordinates remain unscaled after this, the values are just scaled when passing them into GTK. The xwidget code almost certainly requires the same type of adjustments. Strongly recommended for emacs-26. People who don't use scaling will see no side-effects. Robert [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Use-scaled-coordinates-when-calling-into-GTK.patch --] [-- Type: text/x-diff, Size: 3297 bytes --] From 3324e5b4d94d5432a13d0d2828f342a8cf3c1398 Mon Sep 17 00:00:00 2001 From: Robert Pluim <rpluim@gmail.com> Date: Fri, 19 Jan 2018 11:38:07 +0100 Subject: [PATCH] Use scaled coordinates when calling into GTK * src/gtkutil.c (xg_set_geometry): Scale down the coordinates that we pass to gtk_window_move and to gtk_window_parse_geometry. * src/xterm.c (x_set_offset): Likewise. --- src/gtkutil.c | 9 ++++++--- src/xterm.c | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 123236f5f0..83b306a730 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -823,6 +823,7 @@ xg_set_geometry (struct frame *f) { if (f->size_hint_flags & (USPosition | PPosition)) { + int scale = xg_get_scale (f); #if ! GTK_CHECK_VERSION (3, 22, 0) if (x_gtk_use_window_move) { @@ -838,8 +839,9 @@ xg_set_geometry (struct frame *f) f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) - FRAME_PIXEL_HEIGHT (f) + f->top_pos); + /* GTK works in scaled pixels, so convert from X pixels. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); /* Reset size hint flags. */ f->size_hint_flags &= ~ (XNegative | YNegative); @@ -847,9 +849,10 @@ xg_set_geometry (struct frame *f) } else { - int left = f->left_pos; + /* GTK works in scaled pixels, so convert from X pixels. */ + int left = f->left_pos / scale; int xneg = f->size_hint_flags & XNegative; - int top = f->top_pos; + int top = f->top_pos / scale; int yneg = f->size_hint_flags & YNegative; char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; guint id; diff --git a/src/xterm.c b/src/xterm.c index f771631daf..f05ac6147e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10310,6 +10310,7 @@ void x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) { int modified_top, modified_left; + int scale = xg_get_scale (f); if (change_gravity > 0) { @@ -10332,11 +10333,12 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ if (x_gtk_use_window_move) { /* When a position change was requested and the outer GTK widget - has been realized already, leave it to gtk_window_move to DTRT - and return. Used for Bug#25851 and Bug#25943. */ + has been realized already, leave it to gtk_window_move to + DTRT and return. Used for Bug#25851 and Bug#25943. Convert + from X pixels to GTK scaled pixels. */ if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); unblock_input (); return; } @@ -10355,8 +10357,9 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ } #ifdef USE_GTK + /* Make sure we adjust for possible scaling. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - modified_left, modified_top); + modified_left / scale, modified_top / scale); #else XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), modified_left, modified_top); -- 2.16.0.rc1 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 11:11 ` Robert Pluim @ 2018-01-22 16:01 ` Eli Zaretskii 2018-01-22 16:12 ` Robert Pluim 0 siblings, 1 reply; 48+ messages in thread From: Eli Zaretskii @ 2018-01-22 16:01 UTC (permalink / raw) To: Robert Pluim; +Cc: rudalics, emacs-devel, tumashu, dgutov > From: Robert Pluim <rpluim@gmail.com> > Date: Mon, 22 Jan 2018 12:11:26 +0100 > Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org, > Feng Shu <tumashu@163.com> > > Strongly recommended for emacs-26. Why strongly? This problem is quite old, isn't it? ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:01 ` Eli Zaretskii @ 2018-01-22 16:12 ` Robert Pluim 2018-01-22 16:17 ` Eli Zaretskii 0 siblings, 1 reply; 48+ messages in thread From: Robert Pluim @ 2018-01-22 16:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: rudalics, dgutov, tumashu, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: Robert Pluim <rpluim@gmail.com> >> Date: Mon, 22 Jan 2018 12:11:26 +0100 >> Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org, >> Feng Shu <tumashu@163.com> >> >> Strongly recommended for emacs-26. > > Why strongly? This problem is quite old, isn't it? Because we've been dragging our heels on fixing HiDPI issues for ages, and if we don't fix the ones we know about for emacs-26 we'll have another multi-year wait (and HiDPI displays are becoming more and more common). The same comment applies to my frameset-restore patch in <https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00577.html> Robert ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:12 ` Robert Pluim @ 2018-01-22 16:17 ` Eli Zaretskii 2018-01-22 16:25 ` Robert Pluim 0 siblings, 1 reply; 48+ messages in thread From: Eli Zaretskii @ 2018-01-22 16:17 UTC (permalink / raw) To: Robert Pluim; +Cc: emacs-devel > From: Robert Pluim <rpluim@gmail.com> > Cc: rudalics@gmx.at, emacs-devel@gnu.org, tumashu@163.com, dgutov@yandex.ru > Date: Mon, 22 Jan 2018 17:12:10 +0100 > > >> Strongly recommended for emacs-26. > > > > Why strongly? This problem is quite old, isn't it? > > Because we've been dragging our heels on fixing HiDPI issues for ages, > and if we don't fix the ones we know about for emacs-26 we'll have > another multi-year wait (and HiDPI displays are becoming more and more > common). OTOH, if we continue installing non-trivial patches on the release branch, we will not release Emacs 26.1 any time soon. Which one is worse? We must draw the line somewhere, but where is that? ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:17 ` Eli Zaretskii @ 2018-01-22 16:25 ` Robert Pluim 2018-01-22 16:31 ` Eli Zaretskii 0 siblings, 1 reply; 48+ messages in thread From: Robert Pluim @ 2018-01-22 16:25 UTC (permalink / raw) To: emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: Robert Pluim <rpluim@gmail.com> >> Cc: rudalics@gmx.at, emacs-devel@gnu.org, tumashu@163.com, dgutov@yandex.ru >> Date: Mon, 22 Jan 2018 17:12:10 +0100 >> >> >> Strongly recommended for emacs-26. >> > >> > Why strongly? This problem is quite old, isn't it? >> >> Because we've been dragging our heels on fixing HiDPI issues for ages, >> and if we don't fix the ones we know about for emacs-26 we'll have >> another multi-year wait (and HiDPI displays are becoming more and more >> common). > > OTOH, if we continue installing non-trivial patches on the release > branch, we will not release Emacs 26.1 any time soon. Which one is > worse? These two patches are not utterly trivial, but they're hardly complex either (and they fix real bugs). > We must draw the line somewhere, but where is that? In my opinion, the other side of these two fixes. Opinions will vary. [1] Robert Footnotes: [1] Biased in favour of my own patches? Me!? ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:25 ` Robert Pluim @ 2018-01-22 16:31 ` Eli Zaretskii 2018-01-22 16:55 ` Paul Eggert 0 siblings, 1 reply; 48+ messages in thread From: Eli Zaretskii @ 2018-01-22 16:31 UTC (permalink / raw) To: Robert Pluim; +Cc: emacs-devel > From: Robert Pluim <rpluim@gmail.com> > Date: Mon, 22 Jan 2018 17:25:35 +0100 > > >> Because we've been dragging our heels on fixing HiDPI issues for ages, > >> and if we don't fix the ones we know about for emacs-26 we'll have > >> another multi-year wait (and HiDPI displays are becoming more and more > >> common). > > > > OTOH, if we continue installing non-trivial patches on the release > > branch, we will not release Emacs 26.1 any time soon. Which one is > > worse? > > These two patches are not utterly trivial, but they're hardly complex > either (and they fix real bugs). > > > We must draw the line somewhere, but where is that? > > In my opinion, the other side of these two fixes. Opinions will vary. > [1] What do others think? > [1] Biased in favour of my own patches? Me!? Of course not. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:31 ` Eli Zaretskii @ 2018-01-22 16:55 ` Paul Eggert 2018-01-22 16:59 ` Eli Zaretskii 0 siblings, 1 reply; 48+ messages in thread From: Paul Eggert @ 2018-01-22 16:55 UTC (permalink / raw) To: Eli Zaretskii, Robert Pluim; +Cc: emacs-devel On 01/22/2018 08:31 AM, Eli Zaretskii wrote: >> These two patches are not utterly trivial, but they're hardly complex >> either (and they fix real bugs). >> >>> We must draw the line somewhere, but where is that? >> In my opinion, the other side of these two fixes. Opinions will vary. >> [1] > What do others think? > I'd include both patches, as they seem safe and fix real and annoying bugs on scaled GTK displays. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:55 ` Paul Eggert @ 2018-01-22 16:59 ` Eli Zaretskii 2018-01-22 18:59 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Eli Zaretskii @ 2018-01-22 16:59 UTC (permalink / raw) To: Paul Eggert; +Cc: rpluim, emacs-devel > Cc: emacs-devel@gnu.org > From: Paul Eggert <eggert@cs.ucla.edu> > Date: Mon, 22 Jan 2018 08:55:31 -0800 > > On 01/22/2018 08:31 AM, Eli Zaretskii wrote: > >> These two patches are not utterly trivial, but they're hardly complex > >> either (and they fix real bugs). > >> > >>> We must draw the line somewhere, but where is that? > >> In my opinion, the other side of these two fixes. Opinions will vary. > >> [1] > > What do others think? > > > I'd include both patches, as they seem safe and fix real and annoying > bugs on scaled GTK displays. Thanks for chiming in. Anyone else? Martin? ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 16:59 ` Eli Zaretskii @ 2018-01-22 18:59 ` martin rudalics 2018-01-23 1:12 ` Dmitry Gutov 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-22 18:59 UTC (permalink / raw) To: Eli Zaretskii, Paul Eggert; +Cc: rpluim, Dmitry Gutov, emacs-devel >> I'd include both patches, as they seem safe and fix real and annoying >> bugs on scaled GTK displays. > > Thanks for chiming in. > > Anyone else? Martin? I'd include them because (1) there's finally some hope that they will fix most remaining issues in the scaling area and (2) as Robert mentioned they are guarded by the use of xg_get_scale, so they really should affect scaled sessions only. But I would like to hear Dmitry's opinion first. Dmitry, can you try them? Thanks, martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-22 18:59 ` martin rudalics @ 2018-01-23 1:12 ` Dmitry Gutov 2018-01-23 3:36 ` Eli Zaretskii 0 siblings, 1 reply; 48+ messages in thread From: Dmitry Gutov @ 2018-01-23 1:12 UTC (permalink / raw) To: martin rudalics, Eli Zaretskii, Paul Eggert; +Cc: rpluim, emacs-devel On 1/22/18 9:59 PM, martin rudalics wrote: > I'd include them because (1) there's finally some hope that they will > fix most remaining issues in the scaling area and (2) as Robert > mentioned they are guarded by the use of xg_get_scale, so they really > should affect scaled sessions only. > > But I would like to hear Dmitry's opinion first. Dmitry, can you try > them? Thanks for asking. Tried it out, and my vote is yes. I can see no adverse effects, and it really improves the stability of Feng Shu's popup's positioning here (tried this several times, by applying and reverting the patch). ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-23 1:12 ` Dmitry Gutov @ 2018-01-23 3:36 ` Eli Zaretskii 2018-01-24 8:38 ` martin rudalics 0 siblings, 1 reply; 48+ messages in thread From: Eli Zaretskii @ 2018-01-23 3:36 UTC (permalink / raw) To: Dmitry Gutov; +Cc: rudalics, rpluim, eggert, emacs-devel > Cc: rpluim@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dgutov@yandex.ru> > Date: Tue, 23 Jan 2018 04:12:06 +0300 > > On 1/22/18 9:59 PM, martin rudalics wrote: > > > I'd include them because (1) there's finally some hope that they will > > fix most remaining issues in the scaling area and (2) as Robert > > mentioned they are guarded by the use of xg_get_scale, so they really > > should affect scaled sessions only. > > > > But I would like to hear Dmitry's opinion first. Dmitry, can you try > > them? > > Thanks for asking. Tried it out, and my vote is yes. OK, then let's get it into emacs-26. Thanks. ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-23 3:36 ` Eli Zaretskii @ 2018-01-24 8:38 ` martin rudalics 2018-01-24 8:47 ` Robert Pluim 0 siblings, 1 reply; 48+ messages in thread From: martin rudalics @ 2018-01-24 8:38 UTC (permalink / raw) To: Eli Zaretskii, Dmitry Gutov; +Cc: rpluim, eggert, emacs-devel > OK, then let's get it into emacs-26. Pushed to Emacs 26. Let's see whether we laid this to rest now. Thanks to everyone involved, martin ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-24 8:38 ` martin rudalics @ 2018-01-24 8:47 ` Robert Pluim 0 siblings, 0 replies; 48+ messages in thread From: Robert Pluim @ 2018-01-24 8:47 UTC (permalink / raw) To: martin rudalics; +Cc: Eli Zaretskii, eggert, emacs-devel, Dmitry Gutov martin rudalics <rudalics@gmx.at> writes: >> OK, then let's get it into emacs-26. > > Pushed to Emacs 26. Let's see whether we laid this to rest now. I certainly hope so. Of course moving to pure-gtk would also solve it, but that's not a trivial undertaking. > Thanks to everyone involved, martin Thanks Robert ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: set-frame-parameter a child-frame's 'parent-frame error on macOS ? 2018-01-13 11:58 ` martin rudalics 2018-01-13 12:11 ` Dmitry Gutov 2018-01-13 23:57 ` Feng Shu @ 2018-01-13 23:59 ` Feng Shu 2 siblings, 0 replies; 48+ messages in thread From: Feng Shu @ 2018-01-13 23:59 UTC (permalink / raw) To: martin rudalics; +Cc: emacs-devel@gnu.org martin rudalics <rudalics@gmx.at> writes: >> by the way, for this issue: https://github.com/tumashu/company-childframe/issues/2> >> I have tested many times, but can not find the reason. >> >> Do you suggest where I should first find? >> >> 1. Child-frame >> 2. HiDPI >> 3. Window manager >> 4. Other > > I don't understand the issue and not even whether it occurs with MacOS > or Unity. Can you tell me more? Dmitry Gutov's machine seem to active HiDPI feature > martin > -- ^ permalink raw reply [flat|nested] 48+ messages in thread
end of thread, other threads:[~2018-01-24 8:47 UTC | newest] Thread overview: 48+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-01-12 3:02 set-frame-parameter a child-frame's 'parent-frame error on macOS ? tumashu 2018-01-12 8:49 ` martin rudalics 2018-01-12 12:13 ` Feng Shu 2018-01-12 18:47 ` martin rudalics 2018-01-12 19:31 ` Alan Third 2018-01-13 8:49 ` martin rudalics 2018-01-13 3:01 ` tumashu 2018-01-13 8:50 ` martin rudalics 2018-01-13 10:36 ` Feng Shu 2018-01-13 11:58 ` martin rudalics 2018-01-13 12:11 ` Dmitry Gutov 2018-01-13 12:29 ` martin rudalics 2018-01-14 1:07 ` Dmitry Gutov 2018-01-14 9:05 ` martin rudalics 2018-01-14 10:34 ` Dmitry Gutov 2018-01-14 11:19 ` martin rudalics 2018-01-13 23:57 ` Feng Shu 2018-01-14 9:05 ` martin rudalics 2018-01-14 10:35 ` Dmitry Gutov 2018-01-14 11:19 ` martin rudalics 2018-01-15 0:29 ` Dmitry Gutov 2018-01-15 8:49 ` Robert Pluim 2018-01-15 9:38 ` martin rudalics 2018-01-15 11:59 ` Feng Shu 2018-01-16 9:08 ` martin rudalics 2018-01-16 10:33 ` Feng Shu 2018-01-19 18:54 ` martin rudalics 2018-01-20 0:11 ` Feng Shu 2018-01-20 10:34 ` martin rudalics 2018-01-20 13:26 ` Feng Shu 2018-01-15 17:07 ` Dmitry Gutov 2018-01-16 9:07 ` martin rudalics 2018-01-16 10:37 ` Feng Shu 2018-01-16 11:10 ` Robert Pluim 2018-01-22 11:11 ` Robert Pluim 2018-01-22 16:01 ` Eli Zaretskii 2018-01-22 16:12 ` Robert Pluim 2018-01-22 16:17 ` Eli Zaretskii 2018-01-22 16:25 ` Robert Pluim 2018-01-22 16:31 ` Eli Zaretskii 2018-01-22 16:55 ` Paul Eggert 2018-01-22 16:59 ` Eli Zaretskii 2018-01-22 18:59 ` martin rudalics 2018-01-23 1:12 ` Dmitry Gutov 2018-01-23 3:36 ` Eli Zaretskii 2018-01-24 8:38 ` martin rudalics 2018-01-24 8:47 ` Robert Pluim 2018-01-13 23:59 ` Feng Shu
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.