From: Jeff Walsh Date: Tue, 18 Feb 2020 06:13:26 +0000 (+1100) Subject: Set screen/display dpi res to make broadway work as expected X-Git-Tag: emacs-29.0.90~3815 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef67659e985dcc31a48cfb3c5eefcf4d9f6aee6e;p=emacs.git Set screen/display dpi res to make broadway work as expected * src/pgtkterm.c (pgtk_initialize_display_info) (window_state_event, pgtk_term_init): * src/gtkutil.c (xg_create_frame_widgets): * src/pgtkterm.c (pgtk_initialize_display_info) (window_state_event, pgtk_term_init): * src/ftcrfont.c (ftcrfont_open): --- diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 8fffb33ee2c..5bae8dae175 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -136,7 +136,9 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) filename = XCAR (val); size = XFIXNUM (AREF (entity, FONT_SIZE_INDEX)); if (size == 0) + { size = pixel_size; + } block_input (); diff --git a/src/gtkutil.c b/src/gtkutil.c index 6573205e7b9..4bd803c74b5 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1377,7 +1377,6 @@ xg_create_frame_widgets (struct frame *f) wtop = gtk_window_new (type); #ifdef HAVE_PGTK gtk_widget_add_events(wtop, GDK_ALL_EVENTS_MASK); - gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(wtop), TRUE); #endif /* gtk_window_set_has_resize_grip is a Gtk+ 3.0 function but Ubuntu diff --git a/src/pgtkfns.c b/src/pgtkfns.c index e7ab20897b7..69a7430b8d3 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -3160,7 +3160,7 @@ When using Gtk+ tooltips, the tooltip face is not used. */); } - +#ifdef PGTK_DEBUG #include #include void pgtk_log(const char *file, int lineno, const char *fmt, ...) @@ -3181,7 +3181,7 @@ void pgtk_log(const char *file, int lineno, const char *fmt, ...) va_end(ap); fputc('\n', stderr); } -#ifdef PGTK_DEBUG + void pgtk_backtrace(const char *file, int lineno) { Lisp_Object bt = make_uninit_vector(10); diff --git a/src/pgtkterm.c b/src/pgtkterm.c index d7ac68c32f2..0ab86b7a427 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -828,8 +828,8 @@ pgtk_initialize_display_info (struct pgtk_display_info *dpyinfo) Initialize global info and storage for display. -------------------------------------------------------------------------- */ { - dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */ - dpyinfo->resy = 72.27; + dpyinfo->resx = 96; + dpyinfo->resy = 96; dpyinfo->color_p = 1; dpyinfo->n_planes = 32; dpyinfo->root_window = 42; /* a placeholder.. */ @@ -5401,7 +5401,7 @@ static gboolean window_state_event(GtkWidget *widget, GdkEvent *event, gpointer if (inev.ie.kind != NO_EVENT) evq_enqueue(&inev); - return TRUE; + return FALSE; } static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer *user_data) @@ -6297,7 +6297,13 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) { GdkScreen *gscr = gdk_display_get_default_screen(dpyinfo->gdpy); - gdouble dpi = gdk_screen_get_resolution(gscr); + + GSettings *set = g_settings_new("org.gnome.desktop.interface"); + gdouble x = g_settings_get_double(set,"text-scaling-factor"); + gdouble dpi = 0; + + dpi = 96.0 * x; + gdk_screen_set_resolution(gscr, dpi); dpyinfo->resx = dpi; dpyinfo->resy = dpi; }