[gnome-flashback/wip/segeiger/gnome-3-18-inputmethods: 1/3] input-sources: change GfCandidatePopup parent class to GfPopupWindow
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/segeiger/gnome-3-18-inputmethods: 1/3] input-sources: change GfCandidatePopup parent class to GfPopupWindow
- Date: Mon, 18 Jan 2016 14:15:57 +0000 (UTC)
commit 507808d56a079c0491e422bec324810772498f7d
Author: Sebastian Geiger <sbastig gmx net>
Date: Mon Jan 18 13:26:52 2016 +0100
input-sources: change GfCandidatePopup parent class to GfPopupWindow
.../libinput-sources/gf-candidate-popup.c | 10 +++++++---
.../libinput-sources/gf-candidate-popup.h | 4 ++--
gnome-flashback/libinput-sources/gf-ibus-manager.c | 7 ++++++-
3 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.c
b/gnome-flashback/libinput-sources/gf-candidate-popup.c
index 32d6a63..a945af3 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-popup.c
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.c
@@ -21,12 +21,12 @@
struct _GfCandidatePopup
{
- GObject parent;
+ GfPopupWindow parent;
IBusPanelService *service;
};
-G_DEFINE_TYPE (GfCandidatePopup, gf_candidate_popup, G_TYPE_OBJECT)
+G_DEFINE_TYPE (GfCandidatePopup, gf_candidate_popup, GF_TYPE_POPUP_WINDOW)
static void
set_cursor_location_cb (IBusPanelService *service,
@@ -131,12 +131,16 @@ gf_candidate_popup_class_init (GfCandidatePopupClass *popup_class)
static void
gf_candidate_popup_init (GfCandidatePopup *popup)
{
+ gtk_window_set_focus_on_map (GTK_WINDOW (popup), TRUE);
+ gtk_window_set_type_hint (GTK_WINDOW (popup), GDK_WINDOW_TYPE_HINT_NORMAL);
}
GfCandidatePopup *
gf_candidate_popup_new (void)
{
- return g_object_new (GF_TYPE_CANDIDATE_POPUP, NULL);
+ return g_object_new (GF_TYPE_CANDIDATE_POPUP,
+ "type", GTK_WINDOW_POPUP,
+ NULL);
}
void
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.h
b/gnome-flashback/libinput-sources/gf-candidate-popup.h
index 8a79979..788125f 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-popup.h
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.h
@@ -18,14 +18,14 @@
#ifndef GF_CANDIDATE_POPUP_H
#define GF_CANDIDATE_POPUP_H
-#include <glib-object.h>
#include <ibus-1.0/ibus.h>
+#include <libcommon/gf-popup-window.h>
G_BEGIN_DECLS
#define GF_TYPE_CANDIDATE_POPUP gf_candidate_popup_get_type ()
G_DECLARE_FINAL_TYPE (GfCandidatePopup, gf_candidate_popup,
- GF, CANDIDATE_POPUP, GObject)
+ GF, CANDIDATE_POPUP, GfPopupWindow)
GfCandidatePopup *gf_candidate_popup_new (void);
diff --git a/gnome-flashback/libinput-sources/gf-ibus-manager.c
b/gnome-flashback/libinput-sources/gf-ibus-manager.c
index 99b5aac..c122e8a 100644
--- a/gnome-flashback/libinput-sources/gf-ibus-manager.c
+++ b/gnome-flashback/libinput-sources/gf-ibus-manager.c
@@ -387,7 +387,12 @@ gf_ibus_manager_dispose (GObject *object)
manager = GF_IBUS_MANAGER (object);
- g_clear_object (&manager->candidate_popup);
+ if (manager->candidate_popup != NULL)
+ {
+ gtk_widget_destroy (GTK_WIDGET (manager->candidate_popup));
+ manager->candidate_popup = NULL;
+ }
+
g_clear_object (&manager->subprocess);
if (manager->engines != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]