1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix warnings building on Ubuntu 24.04.

This commit is contained in:
Simon Tatham 2024-09-08 17:20:16 +01:00
parent e11c83a4a5
commit 52bb6a3fe2
2 changed files with 11 additions and 8 deletions

View File

@ -7276,8 +7276,7 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
(term->selstate != ABOUT_TO) && (term->selstate != DRAGGING)) {
int encstate = 0, r, c;
bool wheel;
char abuf[32];
int len = 0;
char *response = NULL;
if (term->ldisc) {
@ -7368,14 +7367,18 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
/* Check the extensions in decreasing order of preference. Encoding the release event above assumes that 1006 comes first. */
if (term->xterm_extended_mouse) {
len = sprintf(abuf, "\033[<%d;%d;%d%c", encstate, c, r, a == MA_RELEASE ? 'm' : 'M');
response = dupprintf("\033[<%d;%d;%d%c", encstate, c, r,
a == MA_RELEASE ? 'm' : 'M');
} else if (term->urxvt_extended_mouse) {
len = sprintf(abuf, "\033[%d;%d;%dM", encstate + 32, c, r);
response = dupprintf("\033[%d;%d;%dM", encstate + 32, c, r);
} else if (c <= 223 && r <= 223) {
len = sprintf(abuf, "\033[M%c%c%c", encstate + 32, c + 32, r + 32);
response = dupprintf("\033[M%c%c%c", encstate + 32,
c + 32, r + 32);
}
if (response) {
ldisc_send(term->ldisc, response, strlen(response), false);
sfree(response);
}
if (len > 0)
ldisc_send(term->ldisc, abuf, len, false);
}
return;
}

View File

@ -311,7 +311,7 @@ int main(int argc, char **argv)
gtkcomm_setup();
app = gtk_application_new("org.tartarus.projects.putty.macputty",
G_APPLICATION_FLAGS_NONE);
G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
g_signal_connect(app, "startup", G_CALLBACK(startup), NULL);
g_action_map_add_action_entries(G_ACTION_MAP(app),