mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 22:28:37 -05:00
Stop using GTK3-deprecated gdk_get_display().
The new way is gdk_display_get_name(gdk_display_get_default()), which returns a const char * rather than a char *, so I've also had to fiddle with the prototype and call sites of get_x_display(). (Also included gtkcompat.h into uxputty.c, since that wanted to call gdk_get_display() but didn't previously include it.)
This commit is contained in:
parent
ace0dd64b7
commit
5cef6f96c2
@ -177,4 +177,7 @@
|
|||||||
gtk_box_new(GTK_ORIENTATION_VERTICAL, spacing)
|
gtk_box_new(GTK_ORIENTATION_VERTICAL, spacing)
|
||||||
#define gtk_vscrollbar_new(adjust) \
|
#define gtk_vscrollbar_new(adjust) \
|
||||||
gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, adjust)
|
gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, adjust)
|
||||||
|
|
||||||
|
#define gdk_get_display() gdk_display_get_name(gdk_display_get_default())
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2998,7 +2998,7 @@ void cmdline_error(const char *p, ...)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_x_display(void *frontend)
|
const char *get_x_display(void *frontend)
|
||||||
{
|
{
|
||||||
return gdk_get_display();
|
return gdk_get_display();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ unsigned long getticks(void); /* based on gettimeofday(2) */
|
|||||||
#define FLAG_STDERR_TTY 0x1000
|
#define FLAG_STDERR_TTY 0x1000
|
||||||
|
|
||||||
/* Things pty.c needs from pterm.c */
|
/* Things pty.c needs from pterm.c */
|
||||||
char *get_x_display(void *frontend);
|
const char *get_x_display(void *frontend);
|
||||||
int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
|
int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
|
||||||
long get_windowid(void *frontend);
|
long get_windowid(void *frontend);
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
|
|||||||
close(pty_utmp_helper_pipe); /* just let the child process die */
|
close(pty_utmp_helper_pipe); /* just let the child process die */
|
||||||
pty_utmp_helper_pipe = -1;
|
pty_utmp_helper_pipe = -1;
|
||||||
} else {
|
} else {
|
||||||
char *location = get_x_display(pty->frontend);
|
const char *location = get_x_display(pty->frontend);
|
||||||
int len = strlen(location)+1, pos = 0; /* +1 to include NUL */
|
int len = strlen(location)+1, pos = 0; /* +1 to include NUL */
|
||||||
while (pos < len) {
|
while (pos < len) {
|
||||||
int ret = write(pty_utmp_helper_pipe, location+pos, len - pos);
|
int ret = write(pty_utmp_helper_pipe, location+pos, len - pos);
|
||||||
|
@ -7,11 +7,14 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
|
||||||
|
#include "gtkcompat.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stubs to avoid uxpty.c needing to be linked in.
|
* Stubs to avoid uxpty.c needing to be linked in.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user