After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 598603 - displays window size when moving terminal window
displays window size when moving terminal window
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-15 18:14 UTC by Dan Winship
Modified: 2010-09-20 15:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix window resize popup (1.46 KB, patch)
2010-07-24 10:41 UTC, Nickolas Lloyd
none Details | Review
fix behavior of the window resize popup (1.63 KB, patch)
2010-08-23 21:24 UTC, Nickolas Lloyd
needs-work Details | Review
Fix behavior of window resize popup (1.66 KB, patch)
2010-08-26 03:29 UTC, Nickolas Lloyd
committed Details | Review

Description Dan Winship 2009-10-15 18:14:34 UTC
when moving a gnome-terminal (or xterm, or emacs, etc) window, mutter displays the window size in the middle. metacity only displays the window size when resizing it, not when moving it.
Comment 1 Jon Nettleton 2009-10-15 18:23:55 UTC
Is it time to start removing these legacy behaviours from the window manager in general?
Comment 2 Dan Winship 2009-10-15 18:31:35 UTC
this isn't a legacy behavior; it only shows the popup for terminals and the like, where you frequently want an exact width (eg, 80 columns), and having to eyeball it and ending up with 79 columns would be no good.
Comment 3 Jon Nettleton 2009-10-15 18:41:56 UTC
I understand this.  It was necessary to reduce round trips to remote x-servers in the day and that is why the window manager drew the width.  With the change to client-side gtk windows can't this behaviour be passed onto the responsibility of the application?

Obviously we can't just rip out the behaviour due to legacy apps, but if we are changing little bits around then it might make sense to have them depend on a gconf key being enabled or something.
Comment 4 Owen Taylor 2009-10-15 18:48:50 UTC
I don't see any point in such a change. Pointless incompatibility, since the client would have to know whether the window manager is showing the indicator or not and do different things. Obviously if a client is resizing itself without window manager involvemnet, it will have to display an indicator itself.

What we could do is draw the size indicator in some snazzy way with clutter, but probably not worth a lot of effort just for terminals and other gridded applications.
Comment 5 Nickolas Lloyd 2010-07-24 10:41:36 UTC
Created attachment 166482 [details] [review]
Fix window resize popup

This patch changes the behavior of the window resize popup to that of metacity's.  Only display the window size if the window is actually being resized--not if it is only being moved.

I personally find it useless to display the window size when moving.  It's just one more window on the screen, and it's just plain annoying to have it pop up any time i grab/click the title bar or window menu.
Comment 6 Owen Taylor 2010-07-26 09:16:29 UTC
(In reply to comment #5)
> Created an attachment (id=166482) [details] [review]
> Fix window resize popup
> 
> This patch changes the behavior of the window resize popup to that of
> metacity's.  Only display the window size if the window is actually being
> resized--not if it is only being moved.
> 
> I personally find it useless to display the window size when moving.  It's just
> one more window on the screen, and it's just plain annoying to have it pop up
> any time i grab/click the title bar or window menu.

Have you tracked down why the behavior changed between Metacity and Mutter?
Comment 7 Owen Taylor 2010-08-16 17:52:28 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Created an attachment (id=166482) [details] [review] [details] [review]
> > Fix window resize popup
> > 
> > This patch changes the behavior of the window resize popup to that of
> > metacity's.  Only display the window size if the window is actually being
> > resized--not if it is only being moved.
> > 
> > I personally find it useless to display the window size when moving.  It's just
> > one more window on the screen, and it's just plain annoying to have it pop up
> > any time i grab/click the title bar or window menu.
> 
> Have you tracked down why the behavior changed between Metacity and Mutter?

Ping? This is information I'd like to have to evaluate this patch.
Comment 8 Nickolas Lloyd 2010-08-19 14:33:13 UTC
Sorry Owen, I didn't see your last post.  I'll try to find the cause for the change.  I'll let you know when I've found something.
Comment 9 Nickolas Lloyd 2010-08-19 16:11:16 UTC
Here is the relevant code from metacity-2.30.1:

void
meta_window_refresh_resize_popup (MetaWindow *window)
{
  /*
    ...
   */
  switch (window->display->grab_op)
    {
    case META_GRAB_OP_RESIZING_SE:
    case META_GRAB_OP_RESIZING_S:
    case META_GRAB_OP_RESIZING_SW:
    case META_GRAB_OP_RESIZING_N:
    case META_GRAB_OP_RESIZING_NE:
    case META_GRAB_OP_RESIZING_NW:
    case META_GRAB_OP_RESIZING_W:
    case META_GRAB_OP_RESIZING_E:
    case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
    case META_GRAB_OP_KEYBOARD_RESIZING_S:
    case META_GRAB_OP_KEYBOARD_RESIZING_N:
    case META_GRAB_OP_KEYBOARD_RESIZING_W:
    case META_GRAB_OP_KEYBOARD_RESIZING_E:
    case META_GRAB_OP_KEYBOARD_RESIZING_SE:
    case META_GRAB_OP_KEYBOARD_RESIZING_NE:
    case META_GRAB_OP_KEYBOARD_RESIZING_SW:
    case META_GRAB_OP_KEYBOARD_RESIZING_NW:
      break;

    default:
      /* Not resizing */
      return;
    }
  /*
    ...
   */
}

this section, or any equivalent, does not exist in the current mutter code.  The proposed patch adds this equivalent with the check for meta_grab_op_is_resizing ().  It is arguable whether the following snippet is needed:

-  if (display->grab_window)
+  if (display->grab_window && meta_grab_op_is_resizing (display->grab_op))
     {
       meta_window_refresh_resize_popup (display->grab_window);
     }

but it does at least keep a few if's at the beginning of meta_window_refresh_resize_popup () from being called.

I can't find the commit that introduced this behavior, but it's at least a simple fix.
Comment 10 Owen Taylor 2010-08-23 20:10:02 UTC
git bisect tracks it down to:

commit 94f64797de91d6f7b86ec3da82181052a2036933
Author: Jon Nettleton <jon.nettleton@gmail.com>
Date:   Thu May 7 13:53:47 2009 -0400

    Remove wireframe mode and old effects framework
    
    Remove the reduced_resources preference and all all wireframe logic and effects.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=581812

Jon accidentally took out an extra block of code along with a block of code related to wireframes.

Would you mind redoing your patch to just add back in the relevant block? I'd rather we didn't deviate from Metacity when we aren't actually doing anything different.
Comment 11 Nickolas Lloyd 2010-08-23 21:24:03 UTC
Created attachment 168594 [details] [review]
fix behavior of the window resize popup

Sure thing, this patch just adds the switch statement back in.  Also, I need to learn to use git a bit better....
Comment 12 Owen Taylor 2010-08-23 22:01:08 UTC
Review of attachment 168594 [details] [review]:

Almost -

 * Please make the code match the Metacity code in order, and leave the META_GRAB_OP_NONE check in
 * The Subject line should be restricted to 60-70 characters with the details in the body
 * The body should explain that this is reverting an accidental change and reference the original
   commit (you can do that by abbreviated commit ID - only reference the first 7 digits of the
   commit ID I mentioned)
Comment 13 Nickolas Lloyd 2010-08-26 03:29:21 UTC
Created attachment 168779 [details] [review]
Fix behavior of window resize popup

Sorry about the sloppiness of that last patch.  I think this one covers all the bases.  It puts things to exactly how they are in metacity, minus the wireframe code.
Comment 14 Nickolas Lloyd 2010-09-20 02:06:33 UTC
*ping*
just checking to see if anything needs to be done to get this patch pushed.
Comment 15 Owen Taylor 2010-09-20 15:17:54 UTC
Thanks for the ping. Looks good - pushed.