! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Sometime the title isn't resized when the user unmaximize windows
Status:
RESOLVED: MOVED

Comments

Description Cédric Leporcq 2015-06-21 11:52:42 CEST
This bug only occurs in special cases, when the application start maximized.

Applications affected by this bug: leafpad, geany...
Applications not affected: firefox, thunar...

Steps to reproduce:
1) open an application and maximize it.
2) close it
3) restart it: The window should be maximized
4) unmaximize the window

This bug more problematic if "hide title on maximized windows" is checked. In this case the title isn't visible on the screen.

Expected behavior:
- Title should be resized
- The title should be displayed on the screen.
Comment 1 Cédric Leporcq 2015-06-21 12:09:25 CEST
Created attachment 6320 
Fix resizing window that was previously maximized and closed

Proposed patch to solve the issue.
the problem apparently comes from the initialization of variables that define the size of the previous resized windows.

Thanks for your tests and comments about this patch.
Comment 2 Cédric Leporcq 2015-06-21 12:36:41 CEST
Comment on attachment 6320 
Fix resizing window that was previously maximized and closed

>From 49d89bcb09c3a24832c1f9508b4f97c6378fd03d Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?C=C3=A9dric=20Leporcq?= <cedl38@gmail.com>
>Date: Sun, 21 Jun 2015 11:57:59 +0200
>Subject: [PATCH] Fix #12002 resizing window that was previously maximized and
> closed
>
>---
> src/client.c    | 15 ---------------
> src/placement.c | 16 ++++++++++++++++
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
>diff --git a/src/client.c b/src/client.c
>index 9524211..d076f09 100644
>--- a/src/client.c
>+++ b/src/client.c
>@@ -1810,21 +1810,6 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
>     }
> 
>     /*
>-       Initialize "old" fields once the position is ensured, to avoid
>-       initially maximized or fullscreen windows being placed offscreen
>-       once de-maximized
>-     */
>-    c->old_x = c->x;
>-    c->old_y = c->y;
>-    c->old_width = c->width;
>-    c->old_height = c->height;
>-
>-    c->fullscreen_old_x = c->x;
>-    c->fullscreen_old_y = c->y;
>-    c->fullscreen_old_width = c->width;
>-    c->fullscreen_old_height = c->height;
>-
>-    /*
>        We must call clientApplyInitialState() after having placed the
>        window so that the inital position values are correctly set if the
>        inital state is maximize or fullscreen
>diff --git a/src/placement.c b/src/placement.c
>index 7b0ca22..9297f58 100644
>--- a/src/placement.c
>+++ b/src/placement.c
>@@ -858,6 +858,22 @@ clientInitPosition (Client * c)
>     {
>         clientAutoMaximize (c, full_w, full_h);
>     }
>+
>+    /*
>+       Initialize "old" fields once the position is ensured, to avoid
>+       initially maximized or fullscreen windows being placed offscreen
>+       once de-maximized
>+     */
>+
>+    c->old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->old_width = c->width * 2 / 3;
>+    c->old_height = c->height * 2 / 3;
>+
>+    c->fullscreen_old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->fullscreen_old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->fullscreen_old_width = c->width * 2 / 3;
>+    c->fullscreen_old_height = c->height * 2 / 3;
> }
> 
> void
>-- 
>2.4.3
>
Comment 3 Cédric Leporcq 2015-06-21 12:37:24 CEST
Comment on attachment 6320 
Fix resizing window that was previously maximized and closed

>From 49d89bcb09c3a24832c1f9508b4f97c6378fd03d Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?C=C3=A9dric=20Leporcq?= <cedl38@gmail.com>
>Date: Sun, 21 Jun 2015 11:57:59 +0200
>Subject: [PATCH] Fix #12002 resizing window that was previously maximized and
> closed
>
>---
> src/client.c    | 15 ---------------
> src/placement.c | 16 ++++++++++++++++
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
>diff --git a/src/client.c b/src/client.c
>index 9524211..d076f09 100644
>--- a/src/client.c
>+++ b/src/client.c
>@@ -1810,21 +1810,6 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
>     }
> 
>     /*
>-       Initialize "old" fields once the position is ensured, to avoid
>-       initially maximized or fullscreen windows being placed offscreen
>-       once de-maximized
>-     */
>-    c->old_x = c->x;
>-    c->old_y = c->y;
>-    c->old_width = c->width;
>-    c->old_height = c->height;
>-
>-    c->fullscreen_old_x = c->x;
>-    c->fullscreen_old_y = c->y;
>-    c->fullscreen_old_width = c->width;
>-    c->fullscreen_old_height = c->height;
>-
>-    /*
>        We must call clientApplyInitialState() after having placed the
>        window so that the inital position values are correctly set if the
>        inital state is maximize or fullscreen
>diff --git a/src/placement.c b/src/placement.c
>index 7b0ca22..9297f58 100644
>--- a/src/placement.c
>+++ b/src/placement.c
>@@ -858,6 +858,22 @@ clientInitPosition (Client * c)
>     {
>         clientAutoMaximize (c, full_w, full_h);
>     }
>+
>+    /*
>+       Initialize "old" fields once the position is ensured, to avoid
>+       initially maximized or fullscreen windows being placed offscreen
>+       once de-maximized
>+     */
>+
>+    c->old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->old_width = c->width * 2 / 3;
>+    c->old_height = c->height * 2 / 3;
>+
>+    c->fullscreen_old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->fullscreen_old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->fullscreen_old_width = c->width * 2 / 3;
>+    c->fullscreen_old_height = c->height * 2 / 3;
> }
> 
> void
>-- 
>2.4.3
>
Comment 4 Cédric Leporcq 2015-06-21 12:38:45 CEST
Comment on attachment 6320 
Fix resizing window that was previously maximized and closed

>From 49d89bcb09c3a24832c1f9508b4f97c6378fd03d Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?C=C3=A9dric=20Leporcq?= <cedl38@gmail.com>
>Date: Sun, 21 Jun 2015 11:57:59 +0200
>Subject: [PATCH] Fix #12002 resizing window that was previously maximized and
> closed
>
>---
> src/client.c    | 15 ---------------
> src/placement.c | 16 ++++++++++++++++
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
>diff --git a/src/client.c b/src/client.c
>index 9524211..d076f09 100644
>--- a/src/client.c
>+++ b/src/client.c
>@@ -1810,21 +1810,6 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
>     }
> 
>     /*
>-       Initialize "old" fields once the position is ensured, to avoid
>-       initially maximized or fullscreen windows being placed offscreen
>-       once de-maximized
>-     */
>-    c->old_x = c->x;
>-    c->old_y = c->y;
>-    c->old_width = c->width;
>-    c->old_height = c->height;
>-
>-    c->fullscreen_old_x = c->x;
>-    c->fullscreen_old_y = c->y;
>-    c->fullscreen_old_width = c->width;
>-    c->fullscreen_old_height = c->height;
>-
>-    /*
>        We must call clientApplyInitialState() after having placed the
>        window so that the inital position values are correctly set if the
>        inital state is maximize or fullscreen
>diff --git a/src/placement.c b/src/placement.c
>index 7b0ca22..9297f58 100644
>--- a/src/placement.c
>+++ b/src/placement.c
>@@ -858,6 +858,22 @@ clientInitPosition (Client * c)
>     {
>         clientAutoMaximize (c, full_w, full_h);
>     }
>+
>+    /*
>+       Initialize "old" fields once the position is ensured, to avoid
>+       initially maximized or fullscreen windows being placed offscreen
>+       once de-maximized
>+     */
>+
>+    c->old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->old_width = c->width * 2 / 3;
>+    c->old_height = c->height * 2 / 3;
>+
>+    c->fullscreen_old_x = full_x + (full_w - c->width * 2 / 3) / 2;
>+    c->fullscreen_old_y = full_y + (full_h - c->height * 2 / 3) / 2;
>+    c->fullscreen_old_width = c->width * 2 / 3;
>+    c->fullscreen_old_height = c->height * 2 / 3;
> }
> 
> void
>-- 
>2.4.3
>
Comment 5 Cédric Leporcq 2015-06-21 12:39:59 CEST
Created attachment 6321 
Fix resizing window that was previously maximized and closed
Comment 6 Git Bot editbugs 2020-05-29 12:06:56 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfwm4/-/issues/190.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #12002

Reported by:
Cédric Leporcq
Reported on: 2015-06-21
Last modified on: 2020-05-29

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information