Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize state machine: A fix and a question #2929

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions xrdp/xrdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ struct display_control_monitor_layout_data
enum display_resize_state state;
int last_state_update_timestamp;
int start_time;
/// This flag is set if the state machine needs to
/// shutdown/startup EGFX
int using_egfx;
};

int
Expand Down
6 changes: 4 additions & 2 deletions xrdp/xrdp_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ process_display_control_monitor_layout_data(struct xrdp_wm *wm)
xrdp_encoder_delete(mm->encoder);
mm->encoder = NULL;
}
if (mm->egfx == 0)
if (mm->resize_data->using_egfx == 0)
{
advance_resize_state_machine(mm, WMRZ_SERVER_MONITOR_RESIZE);
}
Expand Down Expand Up @@ -1772,6 +1772,7 @@ process_display_control_monitor_layout_data(struct xrdp_wm *wm)
" xrdp_cache_reset failed %d", error);
return advance_error(error, mm);
}

/* load some stuff */
error = xrdp_wm_load_static_colors_plus(wm, 0);
if (error != 0)
Expand Down Expand Up @@ -1804,7 +1805,7 @@ process_display_control_monitor_layout_data(struct xrdp_wm *wm)
advance_resize_state_machine(mm, WMRZ_EGFX_INITIALIZE);
break;
case WMRZ_EGFX_INITIALIZE:
if (error == 0 && mm->egfx == NULL && mm->egfx_up == 0)
if (mm->resize_data->using_egfx)
{
egfx_initialize(mm);
advance_resize_state_machine(mm, WMRZ_EGFX_INITALIZING);
Expand Down Expand Up @@ -1920,6 +1921,7 @@ dynamic_monitor_process_queue(struct xrdp_mm *self)
const int time = g_time3();
self->resize_data->start_time = time;
self->resize_data->last_state_update_timestamp = time;
self->resize_data->using_egfx = (self->egfx != NULL);
advance_resize_state_machine(self, WMRZ_ENCODER_DELETE);
}
else
Expand Down
Loading