replace some deprecated functions
This commit is contained in:
parent
b8e35947d4
commit
5e237aee3c
9 changed files with 78 additions and 28 deletions
|
@ -866,6 +866,11 @@ static CompletionWindow *addrcompl_create_window( void ) {
|
||||||
* \param cw Window to destroy.
|
* \param cw Window to destroy.
|
||||||
*/
|
*/
|
||||||
static void addrcompl_destroy_window( CompletionWindow *cw ) {
|
static void addrcompl_destroy_window( CompletionWindow *cw ) {
|
||||||
|
GdkDisplay *display;
|
||||||
|
GdkSeat *seat;
|
||||||
|
|
||||||
|
display = gdk_display_get_default();
|
||||||
|
seat = gdk_display_get_default_seat(display);
|
||||||
/* Stop all searches currently in progress */
|
/* Stop all searches currently in progress */
|
||||||
#ifndef USE_ALT_ADDRBOOK
|
#ifndef USE_ALT_ADDRBOOK
|
||||||
addrindex_stop_search( _queryID_ );
|
addrindex_stop_search( _queryID_ );
|
||||||
|
@ -893,7 +898,7 @@ static void addrcompl_destroy_window( CompletionWindow *cw ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Re-enable keyboard, required at least for Gtk3/Win32 */
|
/* Re-enable keyboard, required at least for Gtk3/Win32 */
|
||||||
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
|
gdk_seat_ungrab(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
||||||
* Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
|
* Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -201,13 +201,20 @@ void alertpanel_error_log(const gchar *format, ...)
|
||||||
|
|
||||||
static void alertpanel_show(void)
|
static void alertpanel_show(void)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display;
|
||||||
|
GdkSeat *seat;
|
||||||
|
GdkDevice *device;
|
||||||
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
|
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
|
||||||
manage_window_set_transient(GTK_WINDOW(window));
|
manage_window_set_transient(GTK_WINDOW(window));
|
||||||
gtk_widget_show_all(window);
|
gtk_widget_show_all(window);
|
||||||
value = G_ALERTWAIT;
|
value = G_ALERTWAIT;
|
||||||
|
|
||||||
if (gdk_pointer_is_grabbed())
|
display = gdk_display_get_default();
|
||||||
gdk_pointer_ungrab(GDK_CURRENT_TIME);
|
seat = gdk_display_get_default_seat(display);
|
||||||
|
device = gdk_seat_get_pointer(seat);
|
||||||
|
|
||||||
|
if (gdk_display_device_is_grabbed(display, device))
|
||||||
|
gdk_seat_ungrab(seat);
|
||||||
inc_lock();
|
inc_lock();
|
||||||
while ((value & G_ALERT_VALUE_MASK) == G_ALERTWAIT)
|
while ((value & G_ALERT_VALUE_MASK) == G_ALERTWAIT)
|
||||||
gtk_main_iteration();
|
gtk_main_iteration();
|
||||||
|
|
|
@ -7754,6 +7754,7 @@ static Compose *compose_create(PrefsAccount *account,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static GdkGeometry geometry;
|
static GdkGeometry geometry;
|
||||||
|
GdkRectangle workarea = {0};
|
||||||
|
|
||||||
cm_return_val_if_fail(account != NULL, NULL);
|
cm_return_val_if_fail(account != NULL, NULL);
|
||||||
|
|
||||||
|
@ -7776,9 +7777,12 @@ static Compose *compose_create(PrefsAccount *account,
|
||||||
gtk_window_set_default_size(GTK_WINDOW(window), prefs_common.compose_width,
|
gtk_window_set_default_size(GTK_WINDOW(window), prefs_common.compose_width,
|
||||||
prefs_common.compose_height);
|
prefs_common.compose_height);
|
||||||
|
|
||||||
|
gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
|
||||||
|
&workarea);
|
||||||
|
|
||||||
if (!geometry.max_width) {
|
if (!geometry.max_width) {
|
||||||
geometry.max_width = gdk_screen_width();
|
geometry.max_width = workarea.width;
|
||||||
geometry.max_height = gdk_screen_height();
|
geometry.max_height = workarea.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
|
gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
||||||
* Copyright (C) 1999-2019 the Claws Mail team and Hiroyuki Yamamoto
|
* Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -2248,6 +2248,9 @@ void folderview_close_opened(FolderView *folderview, gboolean dirty)
|
||||||
static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
||||||
gint column, FolderView *folderview)
|
gint column, FolderView *folderview)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display;
|
||||||
|
GdkSeat *seat;
|
||||||
|
GdkDevice *device;
|
||||||
static gboolean can_select = TRUE; /* exclusive lock */
|
static gboolean can_select = TRUE; /* exclusive lock */
|
||||||
gboolean opened;
|
gboolean opened;
|
||||||
FolderItem *item;
|
FolderItem *item;
|
||||||
|
@ -2257,6 +2260,10 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
||||||
START_TIMING("");
|
START_TIMING("");
|
||||||
folderview->selected = row;
|
folderview->selected = row;
|
||||||
|
|
||||||
|
display = gdk_display_get_default();
|
||||||
|
seat = gdk_display_get_default_seat(display);
|
||||||
|
device = gdk_seat_get_pointer(seat);
|
||||||
|
|
||||||
debug_print("newly selected %p, opened %p\n", folderview->selected,
|
debug_print("newly selected %p, opened %p\n", folderview->selected,
|
||||||
folderview->opened);
|
folderview->opened);
|
||||||
if (folderview->opened == row) {
|
if (folderview->opened == row) {
|
||||||
|
@ -2311,8 +2318,8 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
||||||
/* ungrab the mouse event */
|
/* ungrab the mouse event */
|
||||||
if (gtk_widget_has_grab(GTK_WIDGET(ctree))) {
|
if (gtk_widget_has_grab(GTK_WIDGET(ctree))) {
|
||||||
gtk_grab_remove(GTK_WIDGET(ctree));
|
gtk_grab_remove(GTK_WIDGET(ctree));
|
||||||
if (gdk_pointer_is_grabbed())
|
if (gdk_display_device_is_grabbed(display, device))
|
||||||
gdk_pointer_ungrab(GDK_CURRENT_TIME);
|
gdk_seat_ungrab(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open Folder */
|
/* Open Folder */
|
||||||
|
|
|
@ -593,14 +593,18 @@ void gtkut_window_popup(GtkWidget *window)
|
||||||
{
|
{
|
||||||
GdkWindow *gdkwin;
|
GdkWindow *gdkwin;
|
||||||
gint x, y, sx, sy, new_x, new_y;
|
gint x, y, sx, sy, new_x, new_y;
|
||||||
|
GdkRectangle workarea = {0};
|
||||||
|
|
||||||
gdkwin = gtk_widget_get_window(window);
|
gdkwin = gtk_widget_get_window(window);
|
||||||
|
|
||||||
cm_return_if_fail(window != NULL);
|
cm_return_if_fail(window != NULL);
|
||||||
cm_return_if_fail(gdkwin != NULL);
|
cm_return_if_fail(gdkwin != NULL);
|
||||||
|
|
||||||
sx = gdk_screen_width();
|
gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
|
||||||
sy = gdk_screen_height();
|
&workarea);
|
||||||
|
|
||||||
|
sx = workarea.width;
|
||||||
|
sy = workarea.height;
|
||||||
|
|
||||||
gdk_window_get_origin(gdkwin, &x, &y);
|
gdk_window_get_origin(gdkwin, &x, &y);
|
||||||
new_x = x % sx; if (new_x < 0) new_x = 0;
|
new_x = x % sx; if (new_x < 0) new_x = 0;
|
||||||
|
@ -617,14 +621,18 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
|
||||||
GdkWindow *gdkwin;
|
GdkWindow *gdkwin;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
gint sx, sy;
|
gint sx, sy;
|
||||||
|
GdkRectangle workarea = {0};
|
||||||
|
|
||||||
gdkwin = gtk_widget_get_window(widget);
|
gdkwin = gtk_widget_get_window(widget);
|
||||||
|
|
||||||
cm_return_if_fail(widget != NULL);
|
cm_return_if_fail(widget != NULL);
|
||||||
cm_return_if_fail(gdkwin != NULL);
|
cm_return_if_fail(gdkwin != NULL);
|
||||||
|
|
||||||
sx = gdk_screen_width();
|
gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
|
||||||
sy = gdk_screen_height();
|
&workarea);
|
||||||
|
|
||||||
|
sx = workarea.width;
|
||||||
|
sy = workarea.height;
|
||||||
|
|
||||||
/* gdk_window_get_root_origin ever return *rootwindow*'s position */
|
/* gdk_window_get_root_origin ever return *rootwindow*'s position */
|
||||||
gdk_window_get_root_origin(gdkwin, &x, &y);
|
gdk_window_get_root_origin(gdkwin, &x, &y);
|
||||||
|
@ -926,7 +934,6 @@ GtkWidget *gtkut_get_replace_btn(const gchar *button_label)
|
||||||
GtkWidget *gtkut_stock_button(const gchar *stock_image, const gchar *label)
|
GtkWidget *gtkut_stock_button(const gchar *stock_image, const gchar *label)
|
||||||
{
|
{
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
gint i;
|
|
||||||
|
|
||||||
cm_return_val_if_fail(stock_image != NULL, NULL);
|
cm_return_val_if_fail(stock_image != NULL, NULL);
|
||||||
|
|
||||||
|
@ -934,7 +941,6 @@ GtkWidget *gtkut_stock_button(const gchar *stock_image, const gchar *label)
|
||||||
if (label != NULL)
|
if (label != NULL)
|
||||||
gtk_button_set_label(GTK_BUTTON(button), _(label));
|
gtk_button_set_label(GTK_BUTTON(button), _(label));
|
||||||
gtk_button_set_use_underline(GTK_BUTTON(button), TRUE);
|
gtk_button_set_use_underline(GTK_BUTTON(button), TRUE);
|
||||||
gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
|
|
||||||
gtk_button_set_always_show_image(GTK_BUTTON(button), TRUE);
|
gtk_button_set_always_show_image(GTK_BUTTON(button), TRUE);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
||||||
* Copyright (C) 1999-2019 the Claws Mail Team and Hiroyuki Yamamoto
|
* Copyright (C) 1999-2021 the Claws Mail Team and Hiroyuki Yamamoto
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -400,10 +400,11 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
|
||||||
PrefsCloseCallbackFunc close_cb)
|
PrefsCloseCallbackFunc close_cb)
|
||||||
{
|
{
|
||||||
PrefsWindow *prefswindow;
|
PrefsWindow *prefswindow;
|
||||||
gint x = gdk_screen_width();
|
gint x;
|
||||||
gint y = gdk_screen_height();
|
gint y;
|
||||||
static GdkGeometry geometry;
|
static GdkGeometry geometry;
|
||||||
GtkAdjustment *adj;
|
GtkAdjustment *adj;
|
||||||
|
GdkRectangle workarea = {0};
|
||||||
|
|
||||||
prefswindow = g_new0(PrefsWindow, 1);
|
prefswindow = g_new0(PrefsWindow, 1);
|
||||||
|
|
||||||
|
@ -542,6 +543,11 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
|
||||||
|
|
||||||
MANAGE_WINDOW_SIGNALS_CONNECT(prefswindow->window);
|
MANAGE_WINDOW_SIGNALS_CONNECT(prefswindow->window);
|
||||||
|
|
||||||
|
gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()),
|
||||||
|
&workarea);
|
||||||
|
x = workarea.width;
|
||||||
|
y = workarea.height;
|
||||||
|
|
||||||
if (!geometry.min_height) {
|
if (!geometry.min_height) {
|
||||||
|
|
||||||
if (x < 800 && y < 600) {
|
if (x < 800 && y < 600) {
|
||||||
|
|
|
@ -2205,6 +2205,9 @@ void main_window_update_actions_menu(MainWindow *mainwin)
|
||||||
|
|
||||||
void main_window_cursor_wait(MainWindow *mainwin)
|
void main_window_cursor_wait(MainWindow *mainwin)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display;
|
||||||
|
|
||||||
|
display = gdk_display_get_default();
|
||||||
|
|
||||||
if (mainwin->cursor_count == 0) {
|
if (mainwin->cursor_count == 0) {
|
||||||
gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), watch_cursor);
|
gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), watch_cursor);
|
||||||
|
@ -2213,11 +2216,15 @@ void main_window_cursor_wait(MainWindow *mainwin)
|
||||||
|
|
||||||
mainwin->cursor_count++;
|
mainwin->cursor_count++;
|
||||||
|
|
||||||
gdk_flush();
|
gdk_display_flush(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_window_cursor_normal(MainWindow *mainwin)
|
void main_window_cursor_normal(MainWindow *mainwin)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display;
|
||||||
|
|
||||||
|
display = gdk_display_get_default();
|
||||||
|
|
||||||
if (mainwin->cursor_count)
|
if (mainwin->cursor_count)
|
||||||
mainwin->cursor_count--;
|
mainwin->cursor_count--;
|
||||||
|
|
||||||
|
@ -2225,7 +2232,7 @@ void main_window_cursor_normal(MainWindow *mainwin)
|
||||||
gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), NULL);
|
gdk_window_set_cursor(gtk_widget_get_window(mainwin->window), NULL);
|
||||||
textview_cursor_normal(mainwin->messageview->mimeview->textview);
|
textview_cursor_normal(mainwin->messageview->mimeview->textview);
|
||||||
}
|
}
|
||||||
gdk_flush();
|
gdk_display_flush(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lock / unlock the user-interface */
|
/* lock / unlock the user-interface */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
||||||
* Copyright (C) 2003-2021 the Claws Mail team and Hiroyuki Yamamoto
|
* Copyright (C) 2003-2021 the Claws Mail team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -660,10 +660,14 @@ static void prefs_themes_menu_item_activated_cb(GtkWidget *widget, gpointer data
|
||||||
#define MM_INCH 0.0393700787402
|
#define MM_INCH 0.0393700787402
|
||||||
static gdouble prefs_themes_compute_ppi(GdkScreen *screen)
|
static gdouble prefs_themes_compute_ppi(GdkScreen *screen)
|
||||||
{
|
{
|
||||||
gdouble wp = gdk_screen_get_width(screen);
|
GdkRectangle workarea = {0};
|
||||||
gdouble hp = gdk_screen_get_height(screen);
|
GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
|
||||||
gdouble wi = gdk_screen_get_width_mm(screen);
|
|
||||||
gdouble hi = gdk_screen_get_height_mm(screen);
|
gdk_monitor_get_workarea(monitor, &workarea);
|
||||||
|
gdouble wp = workarea.width;
|
||||||
|
gdouble hp = workarea.height;
|
||||||
|
gdouble wi = gdk_monitor_get_width_mm(monitor);
|
||||||
|
gdouble hi = gdk_monitor_get_height_mm(monitor);
|
||||||
gdouble dp, di;
|
gdouble dp, di;
|
||||||
|
|
||||||
debug_print("screen is %f x %f pixels, %f x %f mm\n", wp, hp, wi, hi);
|
debug_print("screen is %f x %f pixels, %f x %f mm\n", wp, hp, wi, hi);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
|
||||||
* Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
|
* Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -3239,16 +3239,20 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
|
||||||
GHashTable *msgid_table;
|
GHashTable *msgid_table;
|
||||||
GHashTable *subject_table = NULL;
|
GHashTable *subject_table = NULL;
|
||||||
GSList * cur;
|
GSList * cur;
|
||||||
|
GdkDisplay *display;
|
||||||
|
|
||||||
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
|
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
|
||||||
gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
|
gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
|
||||||
START_TIMING("");
|
START_TIMING("");
|
||||||
|
|
||||||
if (!mlist) return;
|
if (!mlist) return;
|
||||||
|
|
||||||
|
display = gdk_display_get_default();
|
||||||
|
|
||||||
debug_print("Setting summary from message data...\n");
|
debug_print("Setting summary from message data...\n");
|
||||||
STATUSBAR_PUSH(summaryview->mainwin,
|
STATUSBAR_PUSH(summaryview->mainwin,
|
||||||
_("Setting summary from message data..."));
|
_("Setting summary from message data..."));
|
||||||
gdk_flush();
|
gdk_display_flush(display);
|
||||||
|
|
||||||
g_signal_handlers_block_by_func(G_OBJECT(ctree),
|
g_signal_handlers_block_by_func(G_OBJECT(ctree),
|
||||||
G_CALLBACK(summary_tree_expanded), summaryview);
|
G_CALLBACK(summary_tree_expanded), summaryview);
|
||||||
|
|
Loading…
Reference in a new issue