Skip to content

Commit

Permalink
GUACAMOLE-288: Receive the monitors count in resize channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
corentin-soriano committed Oct 20, 2024
1 parent 783f4c5 commit 26e3e80
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/libguac/guacamole/user-fntypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,15 @@ typedef int guac_user_clipboard_handler(guac_user* user, guac_stream* stream,
* @param height
* The desired height of the display, in pixels.
*
* @param monitors
* The count of monitors.
*
* @return
* Zero if the size event has been successfully handled, non-zero
* otherwise.
*/
typedef int guac_user_size_handler(guac_user* user,
int width, int height);
int width, int height, int monitors);

/**
* Handler for Guacamole file streams received from a user. Each such file
Expand Down
2 changes: 1 addition & 1 deletion src/libguac/guacamole/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ struct guac_user {
*
* Example:
* @code
* int size_handler(guac_user* user, int width, int height);
* int size_handler(guac_user* user, int width, int height, int monitor);
*
* int guac_user_init(guac_user* user, int argc, char** argv) {
* user->size_handler = size_handler;
Expand Down
3 changes: 2 additions & 1 deletion src/libguac/user-handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ int __guac_handle_size(guac_user* user, int argc, char** argv) {
return user->size_handler(
user,
atoi(argv[0]), /* width */
atoi(argv[1]) /* height */
atoi(argv[1]), /* height */
(argc == 3 ? atoi(argv[2]) : 1) /* Monitors count */
);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/kubernetes/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int guac_kubernetes_user_key_handler(guac_user* user, int keysym, int pressed) {

}

int guac_kubernetes_user_size_handler(guac_user* user, int width, int height) {
int guac_kubernetes_user_size_handler(guac_user* user, int width, int height, int monitors) {

/* Get terminal */
guac_client* client = user->client;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/rdp/channels/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void guac_rdp_disp_load_plugin(rdpContext* context) {
}

void guac_rdp_disp_set_size(guac_rdp_disp* disp, guac_rdp_settings* settings,
freerdp* rdp_inst, int width, int height) {
freerdp* rdp_inst, int width, int height, int monitors) {

guac_rect resize = {
.left = 0,
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/rdp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int guac_rdp_user_key_handler(guac_user* user, int keysym, int pressed) {

}

int guac_rdp_user_size_handler(guac_user* user, int width, int height) {
int guac_rdp_user_size_handler(guac_user* user, int width, int height, int monitors) {

guac_client* client = user->client;
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
Expand All @@ -203,7 +203,7 @@ int guac_rdp_user_size_handler(guac_user* user, int width, int height) {
height = height * settings->resolution / user->info.optimal_resolution;

/* Send display update */
guac_rdp_disp_set_size(rdp_client->disp, settings, rdp_inst, width, height);
guac_rdp_disp_set_size(rdp_client->disp, settings, rdp_inst, width, height, monitors);

return 0;

Expand Down
2 changes: 1 addition & 1 deletion src/protocols/ssh/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int guac_ssh_user_key_handler(guac_user* user, int keysym, int pressed) {
return 0;
}

int guac_ssh_user_size_handler(guac_user* user, int width, int height) {
int guac_ssh_user_size_handler(guac_user* user, int width, int height, int monitors) {

/* Get terminal */
guac_client* client = user->client;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/telnet/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int guac_telnet_user_key_handler(guac_user* user, int keysym, int pressed) {

}

int guac_telnet_user_size_handler(guac_user* user, int width, int height) {
int guac_telnet_user_size_handler(guac_user* user, int width, int height, int monitors) {

/* Get terminal */
guac_client* client = user->client;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/vnc/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int guac_vnc_user_key_handler(guac_user* user, int keysym, int pressed) {
}

#ifdef LIBVNC_HAS_SIZE_MSG
int guac_vnc_user_size_handler(guac_user* user, int width, int height) {
int guac_vnc_user_size_handler(guac_user* user, int width, int height, int monitors) {

guac_user_log(user, GUAC_LOG_TRACE, "Running user size handler.");

Expand Down

0 comments on commit 26e3e80

Please sign in to comment.