summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-02-19 14:41:36 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-02-19 14:41:36 +0000
commit5797c72e9c2c17b52c4f7969eae0994636babba6 (patch)
treeccdb8ba3c51044ed2c001f3918d201f34497726e
parentd02cfceb3d1f435a872c3feca94a20455810710c (diff)
parent516776b630d38a7e95b1bc0b33fb1f0e6ecccfbf (diff)
downloadgtk+-5797c72e9c2c17b52c4f7969eae0994636babba6.tar.gz
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master See merge request GNOME/gtk!3224
-rw-r--r--demos/gtk-demo/main.c8
-rw-r--r--demos/widget-factory/widget-factory.c8
-rw-r--r--gtk/gtkimcontextwayland.c10
3 files changed, 14 insertions, 12 deletions
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 5ae00882ac..96ec96e476 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -1052,10 +1052,10 @@ out:
static void
print_version (void)
{
- g_print ("gtk4-demo %d.%d.%d\n",
- gtk_get_major_version (),
- gtk_get_minor_version (),
- gtk_get_micro_version ());
+ g_print ("gtk4-demo %s%s%s\n",
+ PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
}
static int
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index ef952aca6a..8e8da85f4a 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -2329,10 +2329,10 @@ activate (GApplication *app)
static void
print_version (void)
{
- g_print ("gtk4-widget-factory %d.%d.%d\n",
- gtk_get_major_version (),
- gtk_get_minor_version (),
- gtk_get_micro_version ());
+ g_print ("gtk4-widget-factory %s%s%s\n",
+ PACKAGE_VERSION,
+ g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+ g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
}
static int
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c
index 397909064d..0bee5162d9 100644
--- a/gtk/gtkimcontextwayland.c
+++ b/gtk/gtkimcontextwayland.c
@@ -609,7 +609,7 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
int *cursor_pos)
{
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
- const char *preedit_str;
+ char *preedit_str;
if (attrs)
*attrs = NULL;
@@ -628,10 +628,8 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
}
preedit_str =
- context_wayland->current_preedit.text ? context_wayland->current_preedit.text : "";
+ tweak_preedit (context_wayland->current_preedit.text ? context_wayland->current_preedit.text : "");
- if (str)
- *str = tweak_preedit (preedit_str);
if (cursor_pos)
*cursor_pos = g_utf8_strlen (preedit_str,
context_wayland->current_preedit.cursor_begin);
@@ -665,6 +663,10 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
pango_attr_list_insert (*attrs, cursor);
}
}
+ if (str)
+ *str = preedit_str;
+ else
+ g_free (preedit_str);
}
static gboolean