[Commits] [SCM] claws branch, gtk3, created. 3.16.0-71-g40e5f41
ticho at claws-mail.org
ticho at claws-mail.org
Sun Feb 11 18:40:48 CET 2018
The branch, gtk3 has been created
at 40e5f41effe9afed9933b37408fa8e611b07403c (commit)
- Log -----------------------------------------------------------------
commit 40e5f41effe9afed9933b37408fa8e611b07403c
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sun Feb 11 13:24:35 2018 +0100
Make mouse scrolling work with GtkCMCList.
diff --git a/src/gtk/gtkcmclist.c b/src/gtk/gtkcmclist.c
index 44b220d..1610ff5 100644
--- a/src/gtk/gtkcmclist.c
+++ b/src/gtk/gtkcmclist.c
@@ -4633,7 +4633,12 @@ gtk_cmclist_realize (GtkWidget *widget)
attributes.colormap = gtk_widget_get_colormap (widget);
#endif
attributes.event_mask = gtk_widget_get_events (widget);
- attributes.event_mask |= (GDK_EXPOSURE_MASK |
+ attributes.event_mask |= (GDK_SCROLL_MASK |
+#if GTK_CHECK_VERSION(3, 4, 0)
+ GDK_SMOOTH_SCROLL_MASK |
+#endif
+ GDK_POINTER_MOTION_MASK |
+ GDK_EXPOSURE_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_KEY_RELEASE_MASK);
commit 35720e1854ae9f91b8ec6a0e080349f93efb6134
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sun Feb 11 13:10:30 2018 +0100
Correctly name scroll policy constants in GtkCMCList.
Just a cosmetic change to make it more consistent with
GTK+ naming conventions.
diff --git a/src/gtk/gtkcmclist.c b/src/gtk/gtkcmclist.c
index 27daa3e..44b220d 100644
--- a/src/gtk/gtkcmclist.c
+++ b/src/gtk/gtkcmclist.c
@@ -181,8 +181,8 @@ enum {
,
ARG_HADJUSTMENT,
ARG_VADJUSTMENT,
- ARG_HADJUSTMENT_POLICY,
- ARG_VADJUSTMENT_POLICY
+ ARG_HSCROLL_POLICY,
+ ARG_VSCROLL_POLICY
#endif
};
@@ -693,8 +693,8 @@ gtk_cmclist_class_init (GtkCMCListClass *klass)
/* Scrollable interface properties */
g_object_class_override_property (object_class, ARG_HADJUSTMENT, "hadjustment");
g_object_class_override_property (object_class, ARG_VADJUSTMENT, "vadjustment");
- g_object_class_override_property (object_class, ARG_HADJUSTMENT_POLICY, "hscroll-policy");
- g_object_class_override_property (object_class, ARG_VADJUSTMENT_POLICY, "vscroll-policy");
+ g_object_class_override_property (object_class, ARG_HSCROLL_POLICY, "hscroll-policy");
+ g_object_class_override_property (object_class, ARG_VSCROLL_POLICY, "vscroll-policy");
#endif
clist_signals[SELECT_ROW] =
@@ -1054,8 +1054,8 @@ gtk_cmclist_set_arg (GObject *object,
case ARG_VADJUSTMENT:
gtk_cmclist_set_vadjustment (clist, g_value_get_object (value));
break;
- case ARG_HADJUSTMENT_POLICY:
- case ARG_VADJUSTMENT_POLICY:
+ case ARG_HSCROLL_POLICY:
+ case ARG_VSCROLL_POLICY:
break;
#endif
}
@@ -1113,8 +1113,8 @@ gtk_cmclist_get_arg (GObject *object,
case ARG_VADJUSTMENT:
g_value_set_object(value, gtk_cmclist_get_vadjustment(clist));
break;
- case ARG_HADJUSTMENT_POLICY:
- case ARG_VADJUSTMENT_POLICY:
+ case ARG_HSCROLL_POLICY:
+ case ARG_VSCROLL_POLICY:
g_value_set_enum(value, GTK_SCROLL_NATURAL);
break;
#endif
commit 3bac5c33c1206a2e1cc5c2460ca66a7c879e56c2
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sun Feb 11 12:54:33 2018 +0100
Do not draw scrollbar over the column headers in GtkCMCList.
diff --git a/src/gtk/gtkcmclist.c b/src/gtk/gtkcmclist.c
index 369d715..27daa3e 100644
--- a/src/gtk/gtkcmclist.c
+++ b/src/gtk/gtkcmclist.c
@@ -74,6 +74,8 @@
#define COLUMN_LEFT_XPIXEL(clist, colnum) ((clist)->column[(colnum)].area.x + \
(clist)->hoffset)
+static void gtk_cmclist_scrollable_init (GtkScrollableInterface *iface);
+
/* returns the column index from a x pixel location in the
* context of the clist's hoffset */
static inline gint
@@ -513,7 +515,7 @@ gtk_cmclist_get_type (void)
#else
G_DEFINE_TYPE_WITH_CODE (GtkCMCList, gtk_cmclist, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
- NULL))
+ gtk_cmclist_scrollable_init))
#endif
static void
@@ -7896,3 +7898,19 @@ gtk_cmclist_set_button_actions (GtkCMCList *clist,
clist->button_actions[button] = button_actions;
}
}
+
+static gboolean
+gtk_cmclist_get_border (GtkScrollable *scrollable,
+ GtkBorder *border)
+{
+ GtkCMCList *cmclist = GTK_CMCLIST(scrollable);
+
+ border->top = cmclist->column_title_area.height;
+ return TRUE;
+}
+
+static void
+gtk_cmclist_scrollable_init (GtkScrollableInterface *iface)
+{
+ iface->get_border = gtk_cmclist_get_border;
+}
commit c4d74d0e8f779d27871bc98bf34004c1ad7b199c
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sat Feb 10 14:21:31 2018 +0100
Template preferences dialog not using full window height.
diff --git a/src/prefs_template.c b/src/prefs_template.c
index 3b91b9b..6779d0f 100644
--- a/src/prefs_template.c
+++ b/src/prefs_template.c
@@ -204,7 +204,7 @@ static void prefs_template_window_create(void)
gtk_widget_show(scrolled_window);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_container_add(GTK_CONTAINER(vbox), scrolled_window);
+ gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
/* vpaned to separate template settings from templates list */
vpaned = gtk_vpaned_new();
commit 6b9ce4a8fe3639822993ee8709c7cbf0a5d230ab
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sat Feb 10 14:12:34 2018 +0100
GtkBox to GtkGrid in grouplistdialog.c
diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c
index 91fab55..5e9776e 100644
--- a/src/grouplistdialog.c
+++ b/src/grouplistdialog.c
@@ -141,8 +141,8 @@ GSList *grouplist_dialog(Folder *folder)
static void grouplist_dialog_create(void)
{
- GtkWidget *vbox;
- GtkWidget *hbox;
+ GtkWidget *grid;
+ GtkWidget *hgrid;
GtkWidget *msg_label;
GtkWidget *search_button;
GtkWidget *confirm_area;
@@ -167,36 +167,47 @@ static void grouplist_dialog_create(void)
G_CALLBACK(grouplist_size_allocate), NULL);
MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
- vbox = gtk_vbox_new(FALSE, 8);
+ grid = gtk_grid_new();
+ gtk_grid_set_row_spacing(GTK_GRID(grid), 8);
+ gtk_container_set_border_width(GTK_CONTAINER(grid), 8);
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(grid),
+ GTK_ORIENTATION_VERTICAL);
gtk_container_add(GTK_CONTAINER(
- gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
- gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
-
- hbox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_dialog_get_content_area(GTK_DIALOG(dialog))), grid);
msg_label = gtk_label_new(_("Select newsgroups for subscription:"));
- gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0);
-
- hbox = gtk_hbox_new(FALSE, 8);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_set_hexpand(msg_label, TRUE);
+ gtk_widget_set_vexpand(msg_label, FALSE);
+ gtk_widget_set_halign(msg_label, GTK_ALIGN_START);
+ gtk_container_add(GTK_CONTAINER(grid), msg_label);
+
+ hgrid = gtk_grid_new();
+ gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(hgrid),
+ GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_set_hexpand(hgrid, TRUE);
+ gtk_widget_set_vexpand(hgrid, FALSE);
+ gtk_container_add(GTK_CONTAINER(grid), hgrid);
msg_label = gtk_label_new(_("Find groups:"));
- gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(hgrid), msg_label);
entry = gtk_entry_new();
- gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
+ gtk_widget_set_hexpand(entry, TRUE);
+ gtk_container_add(GTK_CONTAINER(hgrid), entry);
g_signal_connect(G_OBJECT(entry), "activate",
G_CALLBACK(entry_activated), NULL);
search_button = gtk_button_new_with_label(_(" Search "));
- gtk_box_pack_start(GTK_BOX(hbox), search_button, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(hgrid), search_button);
g_signal_connect(G_OBJECT(search_button), "clicked",
G_CALLBACK(search_clicked), NULL);
scrolledwin = gtk_scrolled_window_new(NULL, NULL);
- gtk_box_pack_start(GTK_BOX (vbox), scrolledwin, TRUE, TRUE, 0);
+ gtk_widget_set_hexpand(scrolledwin, TRUE);
+ gtk_widget_set_vexpand(scrolledwin, TRUE);
+ gtk_container_add(GTK_CONTAINER(grid), scrolledwin);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolledwin),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -220,11 +231,11 @@ static void grouplist_dialog_create(void)
g_signal_connect(G_OBJECT(ctree), "button-press-event",
G_CALLBACK(button_press_cb), NULL);
- hbox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
status_label = gtk_label_new("");
- gtk_box_pack_start(GTK_BOX(hbox), status_label, FALSE, FALSE, 0);
+ gtk_widget_set_hexpand(status_label, TRUE);
+ gtk_widget_set_vexpand(status_label, FALSE);
+ gtk_widget_set_halign(status_label, GTK_ALIGN_START);
+ gtk_container_add(GTK_CONTAINER(grid), status_label);
gtkut_stock_button_set_create(&confirm_area,
&refresh_button, GTK_STOCK_REFRESH,
commit 02fa37f0df87058fb07f2cd8c88c8ff023b87c9c
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sat Feb 10 10:36:13 2018 +0100
Fix preference dialog page not using full window height.
diff --git a/src/gtk/prefswindow.c b/src/gtk/prefswindow.c
index 99f6362..35d1302 100644
--- a/src/gtk/prefswindow.c
+++ b/src/gtk/prefswindow.c
@@ -435,7 +435,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
prefswindow->vbox = gtk_vbox_new(FALSE, 6);
gtk_widget_show(prefswindow->vbox);
- prefswindow->paned = gtk_hpaned_new();
+ prefswindow->paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show(prefswindow->paned);
gtk_container_add(GTK_CONTAINER(prefswindow->window), prefswindow->vbox);
@@ -463,7 +463,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
prefswindow->table2 = gtk_table_new(1, 2, FALSE);
gtk_widget_show(prefswindow->table2);
- gtk_container_add(GTK_CONTAINER(prefswindow->vbox2), prefswindow->table2);
+ gtk_box_pack_start(GTK_BOX(prefswindow->vbox2), prefswindow->table2, TRUE, TRUE, 0);
prefswindow->labelframe = gtk_frame_new(NULL);
gtk_widget_show(prefswindow->labelframe);
commit 0463f92df16256975e4ad87d9b73b04f148b24ed
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sat Feb 10 10:15:55 2018 +0100
Fix compose textview not using full window height.
diff --git a/src/compose.c b/src/compose.c
index a10aa17..638c8a3 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -8091,8 +8091,8 @@ static Compose *compose_create(PrefsAccount *account,
gtk_widget_show_all(vbox);
/* pane between attach clist and text */
- paned = gtk_vpaned_new();
- gtk_container_add(GTK_CONTAINER(vbox2), paned);
+ paned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
+ gtk_box_pack_start(GTK_BOX(vbox2), paned, TRUE, TRUE, 0);
gtk_paned_pack1(GTK_PANED(paned), notebook, FALSE, FALSE);
gtk_paned_pack2(GTK_PANED(paned), edit_vbox, TRUE, FALSE);
gtk_paned_set_position(GTK_PANED(paned), prefs_common.compose_notebook_height);
commit 83321e1ba147929711ebe3dfb226a166f7cf6736
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Feb 9 23:02:46 2018 +0100
No need to allocate colors via GdkColormap with GTK3.
diff --git a/src/plugins/vcalendar/day-view.c b/src/plugins/vcalendar/day-view.c
index 63d3fbc..bc01080 100644
--- a/src/plugins/vcalendar/day-view.c
+++ b/src/plugins/vcalendar/day-view.c
@@ -650,10 +650,8 @@ static void build_day_view_header(day_win *dw, char *start_date)
static void build_day_view_colours(day_win *dw)
{
GtkStyle *def_style, *cur_style;
- GdkColormap *pic1_cmap;
GtkWidget *ctree = NULL;
def_style = gtk_widget_get_default_style();
- pic1_cmap = gdk_colormap_get_system();
if (mainwindow_get_mainwindow()) {
ctree = mainwindow_get_mainwindow()->summaryview->ctree;
@@ -669,12 +667,10 @@ static void build_day_view_colours(day_win *dw)
dw->bg1.red += (dw->bg1.red < 63000 ? 2000 : -2000);
dw->bg1.green += (dw->bg1.green < 63000 ? 2000 : -2000);
dw->bg1.blue += (dw->bg1.blue < 63000 ? 2000 : -2000);
- gdk_colormap_alloc_color(pic1_cmap, &dw->bg1, FALSE, TRUE);
dw->bg2.red += (dw->bg2.red > 1000 ? -1000 : 1000);
dw->bg2.green += (dw->bg2.green > 1000 ? -1000 : 1000);
dw->bg2.blue += (dw->bg2.blue > 1000 ? -1000 : 1000);
- gdk_colormap_alloc_color(pic1_cmap, &dw->bg2, FALSE, TRUE);
if (!gdk_color_parse("white", &dw->line_color)) {
g_warning("color parse failed: white");
@@ -706,10 +702,6 @@ static void build_day_view_colours(day_win *dw)
dw->bg_today.green = (3*dw->bg_today.green + cur_style->bg[GTK_STATE_NORMAL].red)/4;
dw->bg_today.blue = (3*dw->bg_today.blue + cur_style->bg[GTK_STATE_NORMAL].red)/4;
}
-
- gdk_colormap_alloc_color(pic1_cmap, &dw->line_color, FALSE, TRUE);
- gdk_colormap_alloc_color(pic1_cmap, &dw->fg_sunday, FALSE, TRUE);
- gdk_colormap_alloc_color(pic1_cmap, &dw->bg_today, FALSE, TRUE);
}
static void fill_hour(day_win *dw, gint col, gint row, char *text)
diff --git a/src/plugins/vcalendar/month-view.c b/src/plugins/vcalendar/month-view.c
index e2afed3..4243da4 100644
--- a/src/plugins/vcalendar/month-view.c
+++ b/src/plugins/vcalendar/month-view.c
@@ -726,10 +726,8 @@ static void build_month_view_header(month_win *mw, char *start_date)
static void build_month_view_colours(month_win *mw)
{
GtkStyle *def_style, *cur_style;
- GdkColormap *pic1_cmap;
GtkWidget *ctree = NULL;
def_style = gtk_widget_get_default_style();
- pic1_cmap = gdk_colormap_get_system();
if (mainwindow_get_mainwindow()) {
ctree = mainwindow_get_mainwindow()->summaryview->ctree;
@@ -746,12 +744,10 @@ static void build_month_view_colours(month_win *mw)
mw->bg1.red += (mw->bg1.red < 63000 ? 2000 : -2000);
mw->bg1.green += (mw->bg1.green < 63000 ? 2000 : -2000);
mw->bg1.blue += (mw->bg1.blue < 63000 ? 2000 : -2000);
- gdk_colormap_alloc_color(pic1_cmap, &mw->bg1, FALSE, TRUE);
mw->bg2.red += (mw->bg2.red > 1000 ? -1000 : 1000);
mw->bg2.green += (mw->bg2.green > 1000 ? -1000 : 1000);
mw->bg2.blue += (mw->bg2.blue > 1000 ? -1000 : 1000);
- gdk_colormap_alloc_color(pic1_cmap, &mw->bg2, FALSE, TRUE);
if (!gdk_color_parse("white", &mw->line_color)) {
g_warning("color parse failed: white");
@@ -783,9 +779,6 @@ static void build_month_view_colours(month_win *mw)
mw->bg_today.green = (3*mw->bg_today.green + cur_style->bg[GTK_STATE_NORMAL].red)/4;
mw->bg_today.blue = (3*mw->bg_today.blue + cur_style->bg[GTK_STATE_NORMAL].red)/4;
}
- gdk_colormap_alloc_color(pic1_cmap, &mw->line_color, FALSE, TRUE);
- gdk_colormap_alloc_color(pic1_cmap, &mw->fg_sunday, FALSE, TRUE);
- gdk_colormap_alloc_color(pic1_cmap, &mw->bg_today, FALSE, TRUE);
}
static void fill_hour(month_win *mw, gint col, gint row, char *text)
commit 3cc244f9a1bca5b0e6597796a191868888ea27ff
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Feb 9 22:56:33 2018 +0100
Update vcalendar's build_line() to use cairo instead of GdkPixmap.
diff --git a/src/plugins/vcalendar/common-views.c b/src/plugins/vcalendar/common-views.c
index 3acb48e..4d569bc 100644
--- a/src/plugins/vcalendar/common-views.c
+++ b/src/plugins/vcalendar/common-views.c
@@ -70,41 +70,43 @@ static GtkActionEntry view_event_popup_entries[] =
GtkWidget *build_line(gint start_x, gint start_y
, gint width, gint height, GtkWidget *hour_line, GdkColor *line_color)
{
- GdkColormap *pic1_cmap;
- GdkVisual *pic1_vis;
- GdkPixmap *pic1;
- GdkGC *pic1_gc;
GtkWidget *new_hour_line;
- gint depth = 16;
+ cairo_t *cr;
+ cairo_surface_t *pic1;
gboolean first = FALSE;
+ debug_print("build_line [%d,%d] %dx%d %s\n",
+ start_x, start_y, width, height, hour_line ? "widget" : "no widget");
/*
* GdkPixbuf *scaled;
scaled = gdk_pixbuf_scale_simple (pix, w, h, GDK_INTERP_BILINEAR);
*/
- pic1_cmap = gdk_colormap_get_system();
- pic1_vis = gdk_colormap_get_visual(pic1_cmap);
- depth = gdk_visual_get_depth(pic1_vis);
+ pic1 = cairo_image_surface_create(CAIRO_FORMAT_A1, width, height);
+ cr = cairo_create(pic1);
+
if (hour_line == NULL) {
- pic1 = gdk_pixmap_new(NULL, width, height, depth);
- gdk_drawable_set_colormap(pic1, pic1_cmap);
first = TRUE;
+ } else {
+ gdk_cairo_set_source_pixbuf(cr, gtk_image_get_pixbuf(GTK_IMAGE(hour_line)), 0, 0);
}
- else
- gtk_image_get_pixmap(GTK_IMAGE(hour_line), &pic1, NULL);
- pic1_gc = gdk_gc_new(pic1);
+
if (first) {
- gdk_gc_set_foreground(pic1_gc, line_color);
- gdk_draw_rectangle(pic1, pic1_gc, TRUE, start_x, start_y, width, height);
+ cairo_set_source_rgb(cr,
+ (double)line_color->red/255,
+ (double)line_color->green/255,
+ (double)line_color->blue/255);
+ cairo_rectangle(cr, start_x, start_y, width, height);
}
else {
- gdk_draw_rectangle(pic1, pic1_gc, TRUE, start_x, start_y, width, height);
+ cairo_rectangle(cr, start_x, start_y, width, height);
}
-
- new_hour_line = gtk_image_new_from_pixmap(pic1, NULL);
- g_object_unref(pic1_gc);
- g_object_unref(pic1);
+
+ cairo_fill(cr);
+ cairo_destroy(cr);
+
+ new_hour_line = gtk_image_new_from_surface(pic1);
+ cairo_surface_destroy(pic1);
return(new_hour_line);
}
commit c17621f95e49db1f21dfc3db9eff6a2fc5ba6389
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Feb 9 21:31:13 2018 +0100
Use GObject instead of deprecated and removed GtkObject.
diff --git a/src/plugins/bsfilter/bsfilter_gtk.c b/src/plugins/bsfilter/bsfilter_gtk.c
index c329d68..eb2e9a2 100644
--- a/src/plugins/bsfilter/bsfilter_gtk.c
+++ b/src/plugins/bsfilter/bsfilter_gtk.c
@@ -107,7 +107,7 @@ static void bsfilter_create_widget_func(PrefsPage * _page,
GtkWidget *hbox_mark_as_read;
GtkWidget *max_size_label;
- GtkObject *max_size_spinbtn_adj;
+ GObject *max_size_spinbtn_adj;
GtkWidget *max_size_spinbtn;
GtkWidget *max_size_kb_label;
diff --git a/src/plugins/clamd/clamav_plugin_gtk.c b/src/plugins/clamd/clamav_plugin_gtk.c
index 7519643..a16873b 100644
--- a/src/plugins/clamd/clamav_plugin_gtk.c
+++ b/src/plugins/clamd/clamav_plugin_gtk.c
@@ -217,7 +217,7 @@ static void clamav_create_widget_func(PrefsPage * _page, GtkWindow *window, gpoi
GtkWidget *label1;
/* GtkWidget *enable_arc;*/
GtkWidget *label2;
- GtkObject *max_size_adj;
+ GObject *max_size_adj;
GtkWidget *max_size;
GtkWidget *hbox1;
GtkWidget *recv_infected;
diff --git a/src/plugins/dillo/dillo_viewer.c b/src/plugins/dillo/dillo_viewer.c
index d5eae61..87ec133 100644
--- a/src/plugins/dillo/dillo_viewer.c
+++ b/src/plugins/dillo/dillo_viewer.c
@@ -67,7 +67,7 @@ static GtkWidget *dillo_get_widget(MimeViewer *_viewer)
#if !GTK_CHECK_VERSION(3, 0, 0)
static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
#else
-static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
+static gboolean socket_destroy_cb(GObject *object, gpointer data)
#endif
{
DilloViewer *viewer = (DilloViewer *) data;
diff --git a/src/plugins/rssyl/rssyl_feed_props.c b/src/plugins/rssyl/rssyl_feed_props.c
index a43defe..0ddb58d 100644
--- a/src/plugins/rssyl/rssyl_feed_props.c
+++ b/src/plugins/rssyl/rssyl_feed_props.c
@@ -235,7 +235,7 @@ void rssyl_gtk_prop(RFolderItem *ritem)
*bbox, *cancel_button, *cancel_align,
*cancel_hbox, *cancel_image, *cancel_label, *ok_button, *ok_align,
*ok_hbox, *ok_image, *ok_label, *trim_button, *silent_update_label;
- GtkObject *adj;
+ GObject *adj;
gint refresh;
g_return_if_fail(ritem != NULL);
diff --git a/src/plugins/rssyl/rssyl_prefs.c b/src/plugins/rssyl/rssyl_prefs.c
index afabc92..d0e0ac3 100644
--- a/src/plugins/rssyl/rssyl_prefs.c
+++ b/src/plugins/rssyl/rssyl_prefs.c
@@ -129,7 +129,7 @@ static void create_rssyl_prefs_page(PrefsPage *page,
GtkWidget *refresh, *refresh_enabled, *refresh_hbox;
GtkWidget *label;
GtkWidget *refresh_on_startup;
- GtkObject *refresh_adj;
+ GObject *refresh_adj;
GtkWidget *cookies_path, *cookies_btn, *cookies_hbox;
GtkWidget *ssl_verify_peer;
diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c
index e467678..4aa1c99 100644
--- a/src/plugins/vcalendar/vcal_prefs.c
+++ b/src/plugins/vcalendar/vcal_prefs.c
@@ -249,7 +249,7 @@ static void vcal_prefs_create_widget_func(PrefsPage * _page,
GtkWidget *frame_alert;
GtkWidget *alert_enable_checkbtn;
- GtkObject *alert_enable_spinbtn_adj;
+ GObject *alert_enable_spinbtn_adj;
GtkWidget *alert_enable_h_spinbtn;
GtkWidget *alert_enable_m_spinbtn;
GtkWidget *label_alert_enable;
commit 1d07c0f5db9e4339ada457a8c569503ba6005bf6
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Feb 9 21:28:08 2018 +0100
Limit external editor feature to UNIX OS with X11.
It uses GtkSocket, which is only available on X11
with GTK3.
diff --git a/src/compose.c b/src/compose.c
index 6508ebf..a10aa17 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -31,6 +31,9 @@
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#ifdef GDK_WINDOWING_X11
+#include <gtk/gtkx.h>
+#endif
#include <pango/pango-break.h>
#include <stdio.h>
@@ -353,10 +356,10 @@ static gboolean attach_property_key_pressed (GtkWidget *widget,
GdkEventKey *event,
gboolean *cancelled);
+#ifdef CAN_USE_EXTERNAL_EDITOR
static void compose_exec_ext_editor (Compose *compose);
-#ifdef G_OS_UNIX
static gint compose_exec_ext_editor_real (const gchar *file,
- GdkNativeWindow socket_wid);
+ Window socket_wid);
static gboolean compose_ext_editor_kill (Compose *compose);
static gboolean compose_input_cb (GIOChannel *source,
GIOCondition condition,
@@ -368,7 +371,7 @@ static gboolean compose_get_ext_editor_uses_socket();
static gboolean compose_ext_editor_plug_removed_cb
(GtkSocket *socket,
Compose *compose);
-#endif /* G_OS_UNIX */
+#endif /* CAN_USE_EXTERNAL_EDITOR */
static void compose_undo_state_changed (UndoMain *undostruct,
gint undo_state,
@@ -437,8 +440,10 @@ static void about_show_cb (GtkAction *action,
static void compose_template_activate_cb(GtkWidget *widget,
gpointer data);
+#ifdef CAN_USE_EXTERNAL_EDITOR
static void compose_ext_editor_cb (GtkAction *action,
gpointer data);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
static gint compose_delete_cb (GtkWidget *widget,
GdkEventAny *event,
@@ -662,8 +667,12 @@ static GtkActionEntry compose_entries[] =
/* {"Edit/---", NULL, "---", NULL, NULL, NULL }, */
{"Edit/WrapPara", NULL, N_("_Wrap current paragraph"), "<control>L", NULL, G_CALLBACK(compose_wrap_cb) }, /* 0 */
{"Edit/WrapAllLines", NULL, N_("Wrap all long _lines"), "<control><alt>L", NULL, G_CALLBACK(compose_wrap_all_cb) }, /* 1 */
+
+#ifdef CAN_USE_EXTERNAL_EDITOR
/* {"Edit/---", NULL, "---", NULL, NULL, NULL }, */
{"Edit/ExtEditor", NULL, N_("Edit with e_xternal editor"), "<shift><control>X", NULL, G_CALLBACK(compose_ext_editor_cb) },
+#endif /* CAN_USE_EXTERNAL_EDITOR */
+
#if USE_ENCHANT
/* Spelling menu */
{"Spelling/CheckAllSel", NULL, N_("_Check all or check selection"), NULL, NULL, G_CALLBACK(compose_check_all) },
@@ -1246,8 +1255,10 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
undo_unblock(compose->undostruct);
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
compose->draft_timeout_tag = COMPOSE_DRAFT_TIMEOUT_UNSET;
@@ -1692,8 +1703,10 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
undo_unblock(compose->undostruct);
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
compose->modified = FALSE;
compose_set_title(compose);
@@ -1882,8 +1895,10 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
else
gtk_widget_grab_focus(compose->text);
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (!no_extedit && prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
/*save folder*/
if (msginfo->folder && msginfo->folder->prefs && msginfo->folder->prefs->save_copy_to_folder) {
@@ -2043,8 +2058,10 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
gtk_text_buffer_get_start_iter(textbuf, &iter);
gtk_text_buffer_place_cursor(textbuf, &iter);
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
gtk_widget_grab_focus(compose->header_last->entry);
undo_unblock(compose->undostruct);
@@ -2452,9 +2469,12 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
gtk_widget_grab_focus(compose->text);
- if (prefs_common.auto_exteditor) {
+#ifdef CAN_USE_EXTERNAL_EDITOR
+ if (prefs_common.auto_exteditor) {
compose_exec_ext_editor(compose);
}
+#endif /* CAN_USE_EXTERNAL_EDITOR */
+
compose->modified = FALSE;
compose_set_title(compose);
@@ -7810,9 +7830,10 @@ static Compose *compose_create(PrefsAccount *account,
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Edit", "AutoWrap", "Edit/AutoWrap", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Edit", "AutoIndent", "Edit/AutoIndent", GTK_UI_MANAGER_MENUITEM)
+#ifdef CAN_USE_EXTERNAL_EDITOR
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Edit", "Separator3", "Edit/---", GTK_UI_MANAGER_SEPARATOR)
-
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Edit", "ExtEditor", "Edit/ExtEditor", GTK_UI_MANAGER_MENUITEM)
+#endif /* CAN_USE_EXTERNAL_EDITOR */
#if USE_ENCHANT
/* Spelling menu */
@@ -9517,12 +9538,20 @@ static gboolean attach_property_key_pressed(GtkWidget *widget,
return FALSE;
}
+static gboolean compose_can_autosave(Compose *compose)
+{
+ if (compose->privacy_system && compose->use_encryption)
+ return prefs_common.autosave && prefs_common.autosave_encrypted;
+ else
+ return prefs_common.autosave;
+}
+
+#ifdef CAN_USE_EXTERNAL_EDITOR
static void compose_exec_ext_editor(Compose *compose)
{
-#ifdef G_OS_UNIX
gchar *tmp;
GtkWidget *socket;
- GdkNativeWindow socket_wid = 0;
+ Window socket_wid = 0;
pid_t pid;
gint pipe_fds[2];
@@ -9541,7 +9570,7 @@ static void compose_exec_ext_editor(Compose *compose)
}
/* Create the receiving GtkSocket */
socket = gtk_socket_new ();
- g_signal_connect (GTK_OBJECT(socket), "plug-removed",
+ g_signal_connect (G_OBJECT(socket), "plug-removed",
G_CALLBACK(compose_ext_editor_plug_removed_cb),
compose);
gtk_box_pack_start(GTK_BOX(compose->edit_vbox), socket, TRUE, TRUE, 0);
@@ -9573,11 +9602,7 @@ static void compose_exec_ext_editor(Compose *compose)
compose_set_ext_editor_sensitive(compose, FALSE);
-#ifndef G_OS_WIN32
compose->exteditor_ch = g_io_channel_unix_new(pipe_fds[0]);
-#else
- compose->exteditor_ch = g_io_channel_win32_new_fd(pipe_fds[0]);
-#endif
compose->exteditor_tag = g_io_add_watch(compose->exteditor_ch,
G_IO_IN,
compose_input_cb,
@@ -9612,18 +9637,8 @@ static void compose_exec_ext_editor(Compose *compose)
}
g_free(tmp);
-#endif /* G_OS_UNIX */
-}
-
-static gboolean compose_can_autosave(Compose *compose)
-{
- if (compose->privacy_system && compose->use_encryption)
- return prefs_common.autosave && prefs_common.autosave_encrypted;
- else
- return prefs_common.autosave;
}
-#ifdef G_OS_UNIX
static gboolean compose_get_ext_editor_cmd_valid()
{
gboolean has_s = FALSE;
@@ -9648,7 +9663,7 @@ static gboolean compose_get_ext_editor_cmd_valid()
return TRUE;
}
-static gint compose_exec_ext_editor_real(const gchar *file, GdkNativeWindow socket_wid)
+static gint compose_exec_ext_editor_real(const gchar *file, Window socket_wid)
{
gchar *buf;
gchar *p, *s;
@@ -9896,7 +9911,7 @@ static gboolean compose_ext_editor_plug_removed_cb(GtkSocket *socket, Compose *c
/* returning FALSE allows destruction of the socket */
return FALSE;
}
-#endif /* G_OS_UNIX */
+#endif /* CAN_USE_EXTERNAL_EDITOR */
/**
* compose_undo_state_changed:
@@ -10171,7 +10186,7 @@ static void compose_send_cb(GtkAction *action, gpointer data)
{
Compose *compose = (Compose *)data;
-#ifdef G_OS_UNIX
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (compose->exteditor_tag != -1) {
debug_print("ignoring send: external editor still open\n");
return;
@@ -10673,12 +10688,12 @@ static void compose_close_cb(GtkAction *action, gpointer data)
Compose *compose = (Compose *)data;
AlertValue val;
-#ifdef G_OS_UNIX
+#ifdef CAN_USE_EXTERNAL_EDITOR
if (compose->exteditor_tag != -1) {
if (!compose_ext_editor_kill(compose))
return;
}
-#endif
+#endif /* CAN_USE_EXTERNAL_EDITOR */
if (compose->modified) {
gboolean reedit = (compose->rmode == COMPOSE_REEDIT);
@@ -10781,17 +10796,17 @@ static void compose_template_activate_cb(GtkWidget *widget, gpointer data)
compose_template_apply(compose, tmpl, FALSE);
}
+#ifdef CAN_USE_EXTERNAL_EDITOR
static void compose_ext_editor_cb(GtkAction *action, gpointer data)
{
Compose *compose = (Compose *)data;
-#ifdef G_OS_UNIX
if (compose->exteditor_tag != -1) {
debug_print("ignoring open external editor: external editor still open\n");
return;
}
-#endif
compose_exec_ext_editor(compose);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
}
static void compose_undo_cb(GtkAction *action, gpointer data)
diff --git a/src/compose.h b/src/compose.h
index fee1956..ae2212b 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -43,6 +43,12 @@ typedef struct _AttachInfo AttachInfo;
#define COMPOSE_CHECK_BEFORE_SEND_HOOKLIST "compose_check_before_send"
#define COMPOSE_CREATED_HOOKLIST "compose_created"
+/* Define a convenient macro for further ifdefs around code related to
+ * external editor. */
+#if defined G_OS_UNIX && defined GDK_WINDOWING_X11
+# define CAN_USE_EXTERNAL_EDITOR
+#endif
+
typedef enum
{
COMPOSE_TO,
diff --git a/src/prefs_common.c b/src/prefs_common.c
index f9754bf..995de27 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1660,6 +1660,7 @@ const gchar *prefs_common_get_uri_cmd(void)
#endif
}
+#ifdef CAN_USE_EXTERNAL_EDITOR
const gchar *prefs_common_get_ext_editor_cmd(void)
{
return prefs_common.ext_editor_cmd;
@@ -1676,8 +1677,9 @@ const gchar *prefs_common_get_ext_editor_cmd(void)
g_free(tmp);
return "xdg-open %s";
-#endif
+#endif /* 0 */
}
+#endif /* CAN_USE_EXTERNAL_EDITOR */
gboolean prefs_common_get_use_shred(void)
{
diff --git a/src/prefs_compose_writing.c b/src/prefs_compose_writing.c
index 2f7213d..32f89ac 100644
--- a/src/prefs_compose_writing.c
+++ b/src/prefs_compose_writing.c
@@ -52,7 +52,9 @@ typedef struct _WritingPage
GtkWidget *window;
+#ifdef CAN_USE_EXTERNAL_EDITOR
GtkWidget *checkbtn_autoextedit;
+#endif /* CAN_USE_EXTERNAL_EDITOR */
GtkWidget *checkbtn_reply_account_autosel;
GtkWidget *checkbtn_forward_account_autosel;
GtkWidget *checkbtn_reedit_account_autosel;
@@ -77,7 +79,9 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
GtkWidget *vbox1;
GtkWidget *vbox2;
+#ifdef CAN_USE_EXTERNAL_EDITOR
GtkWidget *checkbtn_autoextedit;
+#endif /* CAN_USE_EXTERNAL_EDITOR */
GtkWidget *frame;
GtkWidget *hbox_autosel;
@@ -140,9 +144,11 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
/* Editing */
vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Editing"));
+#ifdef CAN_USE_EXTERNAL_EDITOR
/* Editing: automatically start the text editor */
PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
_("Automatically launch the external editor"));
+#endif /* CAN_USE_EXTERNAL_EDITOR */
/* Editing: automatically save draft */
hbox_autosave = gtk_hbox_new (FALSE, 8);
@@ -258,8 +264,9 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
SET_TOGGLE_SENSITIVITY (checkbtn_warn_large_insert, spinbtn_warn_large_insert_size);
SET_TOGGLE_SENSITIVITY (checkbtn_warn_large_insert, label_warn_large_insert_size);
-
+#ifdef CAN_USE_EXTERNAL_EDITOR
prefs_writing->checkbtn_autoextedit = checkbtn_autoextedit;
+#endif /* CAN_USE_EXTERNAL_EDITOR */
prefs_writing->checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
prefs_writing->checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
@@ -283,9 +290,10 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
prefs_writing->optmenu_dnd_insert_or_attach = optmenu_dnd_insert_or_attach;
-
+#ifdef CAN_USE_EXTERNAL_EDITOR
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_autoextedit),
prefs_common.auto_exteditor);
+#endif /* CAN_USE_EXTERNAL_EDITOR */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_forward_as_attachment),
prefs_common.forward_as_attachment);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prefs_writing->checkbtn_redirect_keep_from),
@@ -322,8 +330,10 @@ static void prefs_compose_writing_save(PrefsPage *_page)
{
WritingPage *page = (WritingPage *) _page;
+#ifdef CAN_USE_EXTERNAL_EDITOR
prefs_common.auto_exteditor =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_autoextedit));
+#endif /* CAN_USE_EXTERNAL_EDITOR */
prefs_common.forward_as_attachment =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_forward_as_attachment));
prefs_common.redirect_keep_from =
diff --git a/src/prefs_ext_prog.c b/src/prefs_ext_prog.c
index e663c86..52b7943 100644
--- a/src/prefs_ext_prog.c
+++ b/src/prefs_ext_prog.c
@@ -53,11 +53,13 @@ typedef struct _ExtProgPage
GtkWidget *uri_label;
GtkWidget *uri_combo;
GtkWidget *uri_entry;
-
-#endif
+#endif /* !G_OS_WIN32 */
+
GtkWidget *exteditor_label;
+#ifdef CAN_USE_EXTERNAL_EDITOR
GtkWidget *exteditor_combo;
GtkWidget *exteditor_entry;
+#endif /* CAN_USE_EXTERNAL_EDITOR */
GtkWidget *astextviewer_label;
GtkWidget *astextviewer_entry;
@@ -77,10 +79,14 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
GtkWidget *uri_label;
GtkWidget *uri_combo;
GtkWidget *uri_entry;
-#endif
+#endif /* !G_OS_WIN32 */
+
+#ifdef CAN_USE_EXTERNAL_EDITOR
GtkWidget *exteditor_label;
GtkWidget *exteditor_combo;
GtkWidget *exteditor_entry;
+#endif /* CAN_USE_EXTERNAL_EDITOR */
+
GtkWidget *astextviewer_label;
GtkWidget *astextviewer_entry;
int i = 0;
@@ -174,7 +180,9 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
uri_entry = gtk_bin_get_child(GTK_BIN((uri_combo)));
gtk_entry_set_text(GTK_ENTRY(uri_entry), prefs_common.uri_cmd ? prefs_common.uri_cmd : "");
-#endif
+#endif /* !G_OS_WIN32 */
+
+#ifdef CAN_USE_EXTERNAL_EDITOR
exteditor_label = gtk_label_new (_("Text editor"));
gtk_widget_show(exteditor_label);
@@ -206,6 +214,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
exteditor_entry = gtk_bin_get_child(GTK_BIN((exteditor_combo)));
gtk_entry_set_text(GTK_ENTRY(exteditor_entry),
prefs_common.ext_editor_cmd ? prefs_common.ext_editor_cmd : "");
+#endif /* CAN_USE_EXTERNAL_EDITOR */
astextviewer_label = gtk_label_new(_("Command for 'Display as text'"));
gtk_widget_show(astextviewer_label);
@@ -233,7 +242,8 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
#ifndef G_OS_WIN32
SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, uri_label);
SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, uri_combo);
-#endif
+#endif /* !G_OS_WIN32 */
+
#if 0 /* we should do that, but it detaches the editor and breaks
compose.c's external composition. */
SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, exteditor_label);
@@ -257,7 +267,7 @@ static void prefs_ext_prog_save(PrefsPage *_page)
#ifndef G_OS_WIN32
prefs_common.uri_cmd = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->uri_entry), 0, -1);
-#endif
+#endif /* !G_OS_WIN32 */
prefs_common.ext_editor_cmd = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->exteditor_entry), 0, -1);
prefs_common.mime_textviewer = gtk_editable_get_chars
commit 8daa7c79cf26b723abc221504e1a6fe403790453
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Feb 9 21:21:17 2018 +0100
Fix notification plugin's gtkhotkey build with GTK3.
diff --git a/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c b/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
index 24ae075..598d0e5 100644
--- a/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
+++ b/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
@@ -72,7 +72,7 @@ grab_ungrab_with_ignorable_modifiers (GdkWindow *rootwin,
XGrabKey (GDK_WINDOW_XDISPLAY (rootwin),
binding->keycode,
binding->modifiers | mod_masks [i],
- GDK_WINDOW_XWINDOW (rootwin),
+ GDK_WINDOW_XID (rootwin),
False,
GrabModeAsync,
GrabModeAsync);
@@ -80,7 +80,7 @@ grab_ungrab_with_ignorable_modifiers (GdkWindow *rootwin,
XUngrabKey (GDK_WINDOW_XDISPLAY (rootwin),
binding->keycode,
binding->modifiers | mod_masks [i],
- GDK_WINDOW_XWINDOW (rootwin));
+ GDK_WINDOW_XID (rootwin));
}
}
}
@@ -299,8 +299,14 @@ tomboy_keybinder_is_modifier (guint keycode)
gint map_size;
XModifierKeymap *mod_keymap;
gboolean retval = FALSE;
+#ifdef GDK_WINDOWING_X11
+ GdkDisplay *gdk_display;
- mod_keymap = XGetModifierMapping (gdk_display);
+ gdk_display = gdk_display_get_default();
+
+ g_return_val_if_fail(gdk_display != NULL, FALSE);
+
+ mod_keymap = XGetModifierMapping (GDK_DISPLAY_XDISPLAY(gdk_display));
map_size = 8 * mod_keymap->max_keypermod;
@@ -314,6 +320,7 @@ tomboy_keybinder_is_modifier (guint keycode)
}
XFreeModifiermap (mod_keymap);
+#endif
return retval;
}
commit 33f6746558bc184d2e2a7e92b5dc1d8c007c1068
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sat Feb 10 14:32:40 2018 +0100
Remove GTK>=3.2.0 compatibility defines.
No reason to treat some deprecated widgets
as special. They will all get taken care of
in due time.
diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index 6942831..ca9c0b9 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -232,24 +232,4 @@ void auto_configure_service(AutoConfigureData *data);
gboolean auto_configure_service_sync(const gchar *service, const gchar *domain, gchar **srvhost, guint16 *srvport);
#endif
-
-#if GTK_CHECK_VERSION (3, 2, 0)
-#define GTK_TYPE_VBOX GTK_TYPE_BOX
-#define GtkVBox GtkBox
-#define GtkVBoxClass GtkBoxClass
-#define gtk_vbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
- "homogeneous", hmg, "spacing", spc, \
- "orientation", GTK_ORIENTATION_VERTICAL, NULL)
-#define GTK_TYPE_HBOX GTK_TYPE_BOX
-#define GtkHBox GtkBox
-#define GtkHBoxClass GtkBoxClass
-#define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
- "homogeneous", hmg, "spacing", spc, \
- "orientation", GTK_ORIENTATION_HORIZONTAL, NULL)
-#define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL)
-#define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL)
-#define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
- "orientation", GTK_ORIENTATION_VERTICAL, NULL)
-#endif
-
#endif /* __GTKUTILS_H__ */
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list