unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Dmitry Gutov <dgutov@yandex.ru>, tumashu <tumashu@163.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Emacs's set-frame-size can not work well with gnome-shell?
Date: Mon, 27 Jan 2020 20:17:48 +0100	[thread overview]
Message-ID: <5dd35cdd-2914-0b91-a6fd-e8764feecfb0@gmx.at> (raw)
In-Reply-To: <ac08d51e-9b3d-c954-afc7-3d66b5c4c1d4@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

 > I just noticed that dragging the left border of a normal GTK frame moves
 > the right border too here.  So something is rotten.

The reason for this (and I don't know if you've seen it as well) is that
'mouse-resize-frame' consults 'frame-text-height' (and/or
'frame-text-width') in a fairly tight loop and it should not do that.

To reproduce the problem, load the attached foobar.el with emacs -Q
using the command 'reset' to put the frame at some fixed position and
size.  You may have to play with the numbers to get results suitable for
your setup.

The commands 'foo-' and 'foo+' drag the left border a 100 times to the
right or left by three pixels in one step.  The right border should
remain unchanged.  The commands 'bar-' and 'bar+' should do the same
but, in fact, sometimes move the right border as well.  Doing a
'redisplay' or sleeping in between each single movement makes the 'bar'
functions behave more like the 'foo' ones but still not 100%.

The reason might be the way we delay size changes in change_frame_sizes
and eventually process them via do_pending_window_change.  Somehow,
frame size and position can drift apart while we process them and unless
we put some tight synchronization there (via redisplay) or wait long
enough the calculations go wrong.

martin

[-- Attachment #2: foobar.el --]
[-- Type: text/x-emacs-lisp, Size: 1839 bytes --]

(setq frame-resize-pixelwise t)

(defvar left 500)
(defvar top 100)
(defvar width 800)
(defvar height 400)

(defun reset ()
  (interactive)
  (setq left 500)
  (setq top 100)
  (setq width 800)
  (setq height 400)
  (modify-frame-parameters
   nil `((width . (text-pixels . ,width))
	 (height . (text-pixels . ,height))
	 (left . ,left) (top . ,top))))

(defun foo- ()
  (interactive)
  (let ((i 0))
    (while (< i 100)
      (setq left (- left 3))
      (setq width (+ width 3))
      (setq i (1+ i))
      (modify-frame-parameters
       nil `((width . (text-pixels . ,width))
	     (height . (text-pixels . ,height))
	     (left . ,left) (top . ,top)))
;;       (redisplay t)
;;       (sleep-for 0.1)
      )))

(defun foo+ ()
  (interactive)
  (let ((i 0))
    (while (< i 100)
      (setq left (+ left 3))
      (setq width (- width 3))
      (setq i (1+ i))
      (modify-frame-parameters
       nil `((width . (text-pixels . ,width))
	     (height . (text-pixels . ,height))
	     (left . ,left) (top . ,top)))
;;       (redisplay t)
;;       (sleep-for 0.1)
      )))

(defun bar- ()
  (interactive)
  (let ((i 0))
    (while (< i 100)
      (setq left (- left 3))
      (setq width (+ width 3))
      (setq i (1+ i))
      (modify-frame-parameters
       nil `((width . (text-pixels . ,(+ (frame-text-width) 3)))
	     (height . (text-pixels . ,height))
	     (left . ,left) (top . ,top)))
;;       (redisplay t)
;;       (sleep-for 0.1)
      )))

(defun bar+ ()
  (interactive)
  (let ((i 0))
    (while (< i 100)
      (setq left (+ left 3))
      (setq width (- width 3))
      (setq i (1+ i))
      (modify-frame-parameters
       nil `((width . (text-pixels . ,(- (frame-text-width) 3)))
	     (height . (text-pixels . ,height))
	     (left . ,left) (top . ,top)))
;;       (redisplay t)
;;       (sleep-for 0.1)
      )))

  parent reply	other threads:[~2020-01-27 19:17 UTC|newest]

Thread overview: 197+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  2:34 Emacs's set-frame-size can not work well with gnome-shell? tumashu
2020-01-10  9:56 ` martin rudalics
2020-01-11  1:29   ` tumashu
2020-01-11  7:50     ` martin rudalics
2020-01-11  9:56       ` Dmitry Gutov
2020-01-11 10:19         ` martin rudalics
2020-01-11 10:21           ` Dmitry Gutov
2020-01-11 10:35             ` martin rudalics
2020-01-11 11:21               ` Dmitry Gutov
2020-01-11 13:45                 ` martin rudalics
2020-01-14  2:09                   ` Dmitry Gutov
2020-01-14 15:50                     ` martin rudalics
2020-01-15  1:31                       ` Dmitry Gutov
2020-01-15  8:08                         ` martin rudalics
2020-01-15 23:53                           ` Dmitry Gutov
2020-01-16  8:03                             ` martin rudalics
2020-01-16  8:15                               ` Dmitry Gutov
2020-01-16  9:18                                 ` martin rudalics
2020-01-16  9:27                                   ` Dmitry Gutov
2020-01-16  9:44                                     ` martin rudalics
2020-01-16 10:12                                       ` Dmitry Gutov
2020-01-16 10:22                                         ` martin rudalics
2020-01-16 15:03                                           ` Dmitry Gutov
2020-01-16 18:33                                             ` martin rudalics
     [not found]                                               ` <15405719-d58d-44db-f1df-ad3bb272b2fc@yandex.ru>
     [not found]                                                 ` <aba0683f-466c-76cf-9024-e18bfc9fdc94@gmx.at>
2020-01-18  2:05                                                   ` Dmitry Gutov
2020-01-18  2:29                                                     ` Dmitry Gutov
2020-01-18  8:34                                                       ` martin rudalics
2020-01-18 12:27                                                         ` Dmitry Gutov
2020-01-18 13:48                                                           ` martin rudalics
2020-01-19  2:45                                                             ` Dmitry Gutov
2020-01-19  8:52                                                               ` martin rudalics
2020-01-20 14:14                                                                 ` Dmitry Gutov
2020-01-20 15:57                                                                   ` martin rudalics
2020-01-20 22:20                                                                     ` Dmitry Gutov
2020-01-21  8:29                                                                       ` martin rudalics
2020-01-21 11:36                                                                         ` Dmitry Gutov
2020-01-21 16:11                                                                           ` martin rudalics
2020-01-21 21:33                                                                             ` Dmitry Gutov
2020-01-22  9:07                                                                               ` martin rudalics
2020-01-22 10:57                                                                                 ` Dmitry Gutov
2020-01-18  8:32                                                     ` martin rudalics
2020-01-20 13:37                                                       ` Dmitry Gutov
2020-01-20 15:57                                                         ` martin rudalics
2020-01-20 23:02                                                           ` Dmitry Gutov
2020-01-21  8:29                                                             ` martin rudalics
2020-01-21 12:11                                                               ` Dmitry Gutov
2020-01-21 16:12                                                                 ` martin rudalics
2020-01-21 22:26                                                                   ` Dmitry Gutov
2020-01-22  9:08                                                                     ` martin rudalics
2020-01-22 11:35                                                                       ` Dmitry Gutov
2020-01-22 13:18                                                                         ` tumashu
2020-01-22 13:32                                                                           ` Dmitry Gutov
2020-01-22 16:19                                                                             ` Eli Zaretskii
2020-01-22 17:36                                                                             ` martin rudalics
2020-01-22 21:15                                                                               ` Dmitry Gutov
2020-01-25  8:41                                                                                 ` martin rudalics
2020-01-25 10:09                                                                                   ` Dmitry Gutov
2020-01-25 12:10                                                                                     ` martin rudalics
2020-01-26 11:59                                                                                       ` Dmitry Gutov
2020-01-26 17:38                                                                                         ` martin rudalics
2020-01-26 20:50                                                                                           ` Dmitry Gutov
2020-01-28  9:46                                                                                             ` martin rudalics
2020-01-28 15:19                                                                                               ` Dmitry Gutov
2020-01-28 16:20                                                                                                 ` martin rudalics
2020-01-30  2:14                                                                                                   ` Dmitry Gutov
2020-01-27 19:17                                                                                           ` martin rudalics [this message]
2020-01-27 21:15                                                                                             ` Dmitry Gutov
2020-01-28  9:47                                                                                               ` martin rudalics
2020-01-30  2:10                                                                                                 ` Dmitry Gutov
2020-01-30  9:38                                                                                                   ` martin rudalics
2020-01-30 17:21                                                                                                     ` martin rudalics
2020-01-30 18:15                                                                                                       ` Dmitry Gutov
2020-01-30 18:41                                                                                                         ` martin rudalics
2020-01-31  1:22                                                                                                           ` Dmitry Gutov
2020-01-31  9:29                                                                                                             ` martin rudalics
2020-01-31 11:52                                                                                                               ` Dmitry Gutov
2020-01-31 15:44                                                                                                                 ` martin rudalics
2020-01-31 22:22                                                                                                                   ` Dmitry Gutov
2020-02-01  9:35                                                                                                                     ` martin rudalics
2020-02-05  1:39                                                                                                                       ` Dmitry Gutov
2020-02-05  9:15                                                                                                                         ` martin rudalics
2020-02-10  7:06                                                                                                                           ` Dmitry Gutov
2020-02-10 17:53                                                                                                                             ` martin rudalics
2020-02-10 22:40                                                                                                                               ` Dmitry Gutov
2020-02-10  7:22                                                                                                                           ` Dmitry Gutov
2020-02-10 17:54                                                                                                                             ` martin rudalics
2020-02-10 22:49                                                                                                                               ` Dmitry Gutov
2020-02-13 18:42                                                                                                                                 ` martin rudalics
2020-02-13 23:48                                                                                                                                   ` Dmitry Gutov
2020-02-14  8:48                                                                                                                                     ` martin rudalics
2020-02-15 22:31                                                                                                                                       ` Dmitry Gutov
2020-02-16 10:01                                                                                                                                         ` martin rudalics
2020-02-16 20:47                                                                                                                                           ` Dmitry Gutov
2020-02-17 18:20                                                                                                                                             ` martin rudalics
2020-02-21 11:03                                                                                                                                               ` Dmitry Gutov
2020-02-21 11:13                                                                                                                                                 ` Dmitry Gutov
2020-02-21 16:08                                                                                                                                                   ` martin rudalics
2020-02-24  0:11                                                                                                                                                     ` Dmitry Gutov
2020-02-26 17:30                                                                                                                                                       ` martin rudalics
2020-02-28 16:32                                                                                                                                                         ` martin rudalics
2020-03-03 13:50                                                                                                                                                           ` Dmitry Gutov
2020-03-03 14:40                                                                                                                                                             ` martin rudalics
2020-03-03 18:27                                                                                                                                                               ` Dmitry Gutov
2020-03-04 17:29                                                                                                                                                                 ` martin rudalics
2020-03-06 23:38                                                                                                                                                                   ` Dmitry Gutov
2020-03-07  0:07                                                                                                                                                                   ` Dmitry Gutov
2020-03-06 23:03                                                                                                                                                         ` Dmitry Gutov
2020-02-16 23:01                                                                                                                                           ` Dmitry Gutov
2020-02-17 18:21                                                                                                                                             ` martin rudalics
2020-02-21 14:18                                                                                                                                               ` Dmitry Gutov
2020-02-21 16:08                                                                                                                                                 ` martin rudalics
2020-02-23  9:22                                                                                                                                                   ` Dmitry Gutov
2020-02-26 17:30                                                                                                                                                     ` martin rudalics
2020-03-06 23:32                                                                                                                                                       ` Dmitry Gutov
2020-03-09  9:03                                                                                                                                                         ` martin rudalics
2020-03-12  0:22                                                                                                                                                           ` Dmitry Gutov
2020-03-12  8:23                                                                                                                                                             ` martin rudalics
2020-03-13 16:57                                                                                                                                                               ` Dmitry Gutov
2020-03-13 17:46                                                                                                                                                                 ` martin rudalics
2020-03-16 19:51                                                                                                                                                                   ` Dmitry Gutov
2020-03-17  9:38                                                                                                                                                                     ` martin rudalics
2020-03-17 11:22                                                                                                                                                                       ` Dmitry Gutov
2020-03-31 17:04                                                                                                                                                                         ` martin rudalics
2020-04-03 11:09                                                                                                                                                                           ` Eli Zaretskii
2020-04-03 15:08                                                                                                                                                                             ` martin rudalics
2020-04-03 16:08                                                                                                                                                                               ` martin rudalics
2020-04-03 19:07                                                                                                                                                                               ` Dmitry Gutov
2020-04-04  8:51                                                                                                                                                                               ` Eli Zaretskii
2020-04-04  9:02                                                                                                                                                                                 ` martin rudalics
2020-04-04  9:30                                                                                                                                                                                   ` Eli Zaretskii
2020-04-06  9:03                                                                                                                                                                                     ` martin rudalics
2020-04-06 13:26                                                                                                                                                                                       ` Eli Zaretskii
2020-04-07  8:32                                                                                                                                                                                         ` martin rudalics
2020-04-07 14:04                                                                                                                                                                                           ` Eli Zaretskii
2020-04-06 18:36                                                                                                                                                                                       ` Dmitry Gutov
2020-04-07  8:33                                                                                                                                                                                         ` martin rudalics
2020-04-07 13:19                                                                                                                                                                                           ` Dmitry Gutov
2020-04-12  6:44                                                                                                                                                                           ` Andreas Schwab
2020-04-12  7:23                                                                                                                                                                             ` Eli Zaretskii
2020-04-12  7:37                                                                                                                                                                               ` Andreas Schwab
2020-04-12  8:03                                                                                                                                                                             ` martin rudalics
2020-04-06 22:51                                                                                                                                                               ` Dmitry Gutov
2020-04-07  8:33                                                                                                                                                                 ` martin rudalics
2020-04-07 14:25                                                                                                                                                                   ` Dmitry Gutov
2020-04-07 14:39                                                                                                                                                                     ` Robert Pluim
2020-04-07 14:50                                                                                                                                                                       ` Dmitry Gutov
2020-04-07 15:37                                                                                                                                                                         ` Robert Pluim
2020-04-07 19:25                                                                                                                                                                           ` Dmitry Gutov
2020-04-08  7:59                                                                                                                                                                             ` Robert Pluim
2020-04-08 10:37                                                                                                                                                                               ` Dmitry Gutov
2020-04-08 12:12                                                                                                                                                                                 ` Robert Pluim
2020-04-08  8:31                                                                                                                                                                   ` Support
2020-04-08  8:45                                                                                                                                                                     ` martin rudalics
2020-04-08  9:03                                                                                                                                                                       ` Adrián Medraño Calvo
2020-04-08  9:25                                                                                                                                                                         ` martin rudalics
2020-02-14  9:52                                                                                                                                     ` martin rudalics
2020-02-15 22:49                                                                                                                                       ` Dmitry Gutov
2020-02-16 10:01                                                                                                                                         ` martin rudalics
2020-01-27 23:20                                                                                           ` Dmitry Gutov
2020-01-27 23:32                                                                                             ` Dmitry Gutov
2020-01-28  9:48                                                                                               ` martin rudalics
2020-01-28 15:39                                                                                                 ` Dmitry Gutov
2020-01-28 16:20                                                                                                   ` martin rudalics
2020-01-28  9:48                                                                                             ` martin rudalics
2020-01-28 15:51                                                                                               ` Dmitry Gutov
2020-01-22 17:35                                                                         ` martin rudalics
2020-01-22 22:40                                                                           ` tumashu
2020-01-25  8:41                                                                             ` martin rudalics
2020-01-25 10:17                                                                               ` Dmitry Gutov
2020-01-25 10:29                                                                                 ` Eli Zaretskii
2020-01-25 10:52                                                                                   ` Dmitry Gutov
2020-01-25 12:11                                                                                 ` martin rudalics
2020-01-25 23:01                                                                                   ` Dmitry Gutov
2020-01-26  8:43                                                                                     ` martin rudalics
2020-01-26 11:02                                                                                       ` Dmitry Gutov
2020-01-26 15:32                                                                                         ` martin rudalics
2020-01-26 21:35                                                                                           ` Dmitry Gutov
2020-01-28  9:46                                                                                             ` martin rudalics
2020-01-30  2:23                                                                                               ` Dmitry Gutov
2020-01-30  9:38                                                                                                 ` martin rudalics
2020-01-30 17:32                                                                                                   ` Dmitry Gutov
2020-01-30 18:04                                                                                                     ` martin rudalics
2020-01-30 17:42                                                                                                   ` Dmitry Gutov
2020-01-30 18:04                                                                                                     ` martin rudalics
2020-01-26 11:03                                                                                   ` Dmitry Gutov
2020-01-23  0:21                                                                           ` Dmitry Gutov
2020-01-23  0:39                                                                             ` tumashu
2020-01-25  8:42                                                                             ` martin rudalics
2020-01-16  0:04                       ` Dmitry Gutov
2020-01-16  8:04                         ` martin rudalics
2020-01-16  8:25                           ` Dmitry Gutov
2020-01-11 10:36       ` tumashu
2020-01-11 13:45         ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2020-01-22  8:04 tumashu
2020-01-22  9:09 ` martin rudalics
2020-01-22 10:03   ` tumashu
2020-01-22 17:33     ` martin rudalics
2020-01-22 15:55 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5dd35cdd-2914-0b91-a6fd-e8764feecfb0@gmx.at \
    --to=rudalics@gmx.at \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=tumashu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).