From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Roland Winkler <winkler@gnu.org>
Cc: 23925@debbugs.gnu.org,
"Clément Pit-Claudel" <clement.pit@gmail.com>,
"Dmitry Gutov" <dgutov@yandex.ru>
Subject: bug#23925: 25.0.95; display broken when maximizing frame
Date: Tue, 26 Mar 2019 11:12:25 +0900 [thread overview]
Message-ID: <wlftrae646.wl-mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <0f5b640c-593c-aeb1-921c-f1d7b5bd9fa8@gmail.com>
On Tue, 18 Dec 2018 04:28:17 +0900,
Clément Pit-Claudel wrote:
>
> >> I have just tried a --with-cairo build of the latest master, and can't repro any of the symptoms described here, as long as Emacs is launched with GDK_SCALE=1 (I have a HiDPI screen, and redisplay with scale=2 looks very broken).
> >
> > And with the current emacs-26 branch, even that is not a problem.
> >
> > So to sum up, I'm failing to reproduce any of the problems described in this bug report. Could any of the previous commenters try?
>
> I just tried it again, on master. I can't reproduce the problem any more.
With cairo, I can still see the problem that enlarging the frame by
mouse does not update the newly added area on master, with XQuartz on
macOS. The following patch works for me.
Does the OP still have the similar problem on master? If so, could
you try the patch below?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
diff --git a/src/xterm.c b/src/xterm.c
index 1b0c2f5ec5..ec89091d2a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -299,6 +299,10 @@ record_event (char *locus, int type)
#define FRAME_CR_CONTEXT(f) ((f)->output_data.x->cr_context)
#define FRAME_CR_SURFACE(f) ((f)->output_data.x->cr_surface)
+#define FRAME_CR_SURFACE_DESIRED_WIDTH(f) \
+ ((f)->output_data.x->cr_surface_desired_width)
+#define FRAME_CR_SURFACE_DESIRED_HEIGHT(f) \
+ ((f)->output_data.x->cr_surface_desired_height)
static struct x_gc_ext_data *
x_gc_get_ext_data (struct frame *f, GC gc, int create_if_not_found_p)
@@ -333,6 +337,22 @@ x_extension_initialize (struct x_display_info *dpyinfo)
dpyinfo->ext_codes = ext_codes;
}
+static void
+x_cr_set_surface_desired_size (struct frame *f, int width, int height)
+{
+ cairo_surface_t *surface = FRAME_CR_SURFACE (f);
+
+ if (surface
+ && cairo_image_surface_get_width (surface) == width
+ && cairo_image_surface_get_height (surface) == height)
+ FRAME_CR_SURFACE_DESIRED_WIDTH (f) = 0;
+ else
+ {
+ FRAME_CR_SURFACE_DESIRED_WIDTH (f) = width;
+ FRAME_CR_SURFACE_DESIRED_HEIGHT (f) = height;
+ }
+}
+
static void
x_cr_destroy_surface (struct frame *f)
{
@@ -350,22 +370,24 @@ cairo_t *
x_begin_cr_clip (struct frame *f, GC gc)
{
cairo_t *cr = FRAME_CR_CONTEXT (f);
+ cairo_surface_t *surface = FRAME_CR_SURFACE (f);
- if (!cr)
+ if (! surface || FRAME_CR_SURFACE_DESIRED_WIDTH (f))
{
+ if (surface)
+ cairo_surface_destroy (surface);
- if (! FRAME_CR_SURFACE (f))
- {
- int scale = 1;
-#ifdef USE_GTK
- scale = xg_get_scale (f);
-#endif
+ FRAME_CR_SURFACE (f) =
+ cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+ FRAME_CR_SURFACE_DESIRED_WIDTH (f),
+ FRAME_CR_SURFACE_DESIRED_HEIGHT (f));
+ FRAME_CR_SURFACE_DESIRED_WIDTH (f) = 0;
- FRAME_CR_SURFACE (f) =
- cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- scale * FRAME_PIXEL_WIDTH (f),
- scale * FRAME_PIXEL_HEIGHT (f));
- }
+ if (cr) cairo_destroy (cr);
+ cr = NULL;
+ }
+ if (!cr)
+ {
cr = cairo_create (FRAME_CR_SURFACE (f));
FRAME_CR_CONTEXT (f) = cr;
}
@@ -989,41 +1011,7 @@ x_set_frame_alpha (struct frame *f)
static void
x_update_begin (struct frame *f)
{
-#ifdef USE_CAIRO
- if (FRAME_TOOLTIP_P (f) && !FRAME_VISIBLE_P (f))
- return;
-
- if (! FRAME_CR_SURFACE (f))
- {
- int width, height;
-#ifdef USE_GTK
- if (FRAME_GTK_WIDGET (f))
- {
- GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
- int scale = xg_get_scale (f);
- width = scale * gdk_window_get_width (w);
- height = scale * gdk_window_get_height (w);
- }
- else
-#endif
- {
- width = FRAME_PIXEL_WIDTH (f);
- height = FRAME_PIXEL_HEIGHT (f);
- if (! FRAME_EXTERNAL_TOOL_BAR (f))
- height += FRAME_TOOL_BAR_HEIGHT (f);
- if (! FRAME_EXTERNAL_MENU_BAR (f))
- height += FRAME_MENU_BAR_HEIGHT (f);
- }
-
- if (width > 0 && height > 0)
- {
- block_input();
- FRAME_CR_SURFACE (f) = cairo_image_surface_create
- (CAIRO_FORMAT_ARGB32, width, height);
- unblock_input();
- }
- }
-#endif /* USE_CAIRO */
+ /* Nothing to do. */
}
/* Start update of window W. */
@@ -8772,7 +8760,9 @@ handle_one_xevent (struct x_display_info *dpyinfo,
font_drop_xrender_surfaces (f);
unblock_input ();
#ifdef USE_CAIRO
- if (f) x_cr_destroy_surface (f);
+ if (f)
+ x_cr_set_surface_desired_size (f, configureEvent.xconfigure.width,
+ configureEvent.xconfigure.height);
#endif
#ifdef USE_GTK
if (!f
@@ -8786,7 +8776,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
xg_frame_resized (f, configureEvent.xconfigure.width,
configureEvent.xconfigure.height);
#ifdef USE_CAIRO
- x_cr_destroy_surface (f);
+ x_cr_set_surface_desired_size (f, configureEvent.xconfigure.width,
+ configureEvent.xconfigure.height);
#endif
f = 0;
}
@@ -11834,7 +11825,7 @@ x_free_frame_resources (struct frame *f)
free_frame_xic (f);
#endif
- x_free_cr_resources (f);
+ x_cr_destroy_surface (f);
#ifdef USE_X_TOOLKIT
if (f->output_data.x->widget)
{
diff --git a/src/xterm.h b/src/xterm.h
index 972a10f4d4..3456e12d84 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -744,6 +744,10 @@ struct x_output
cairo_t *cr_context;
/* Cairo surface for double buffering */
cairo_surface_t *cr_surface;
+ /* Size reported by the last ConfigureNotify event. The value of
+ cr_surface_desired_width is 0 when the size matches with that of
+ cr_surface above. */
+ int cr_surface_desired_width, cr_surface_desired_height;
#endif
};
next prev parent reply other threads:[~2019-03-26 2:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 3:02 bug#23925: 25.0.95; display broken when maximizing frame Roland Winkler
2016-07-09 7:11 ` Eli Zaretskii
2016-07-09 9:45 ` Clément Pit--Claudel
2016-07-09 15:30 ` martin rudalics
2016-07-10 1:52 ` Clément Pit--Claudel
2016-07-11 9:14 ` martin rudalics
2016-07-11 17:47 ` Clément Pit--Claudel
2016-07-12 7:29 ` martin rudalics
2016-07-12 9:29 ` Clément Pit--Claudel
2016-07-13 14:58 ` Roland Winkler
2016-07-13 17:34 ` martin rudalics
2018-11-22 14:12 ` Dmitry Gutov
2018-12-11 1:40 ` Dmitry Gutov
2018-12-17 19:28 ` Clément Pit-Claudel
2019-03-26 2:12 ` YAMAMOTO Mitsuharu [this message]
2019-06-18 20:03 ` Clément Pit-Claudel
2019-06-18 21:33 ` Dmitry Gutov
2019-06-19 0:26 ` YAMAMOTO Mitsuharu
2019-06-19 1:22 ` Dmitry Gutov
2019-06-19 1:38 ` YAMAMOTO Mitsuharu
2019-06-19 1:48 ` Dmitry Gutov
2019-06-19 14:07 ` Clément Pit-Claudel
2019-06-21 0:36 ` YAMAMOTO Mitsuharu
2019-06-19 3:31 ` Roland Winkler
2019-06-18 23:52 ` YAMAMOTO Mitsuharu
2018-12-11 3:36 ` Dmitry Gutov
2018-12-11 8:49 ` Robert Pluim
2016-07-09 21:05 ` Roland Winkler
2016-07-09 9:20 ` martin rudalics
2016-07-09 17:32 ` Glenn Morris
2016-07-09 17:42 ` Eli Zaretskii
2016-07-10 1:03 ` Glenn Morris
2016-07-10 14:27 ` Eli Zaretskii
2016-07-15 15:46 ` Roland Winkler
2016-07-15 16:04 ` Eli Zaretskii
2016-07-23 17:44 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlftrae646.wl-mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=23925@debbugs.gnu.org \
--cc=clement.pit@gmail.com \
--cc=dgutov@yandex.ru \
--cc=winkler@gnu.org \
/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 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.