[digesting_libdecor] simplify frame_commit
parent
4d5a266cfe
commit
6e0c97bfcd
|
|
@ -1259,29 +1259,12 @@ libdecor_frame_commit(void){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (csd){
|
if (csd){
|
||||||
enum libdecor_window_state old_window_state = ctx.gtk_window_state;
|
ctx.gtk_content_width = ctx.frame_content_width;
|
||||||
enum libdecor_window_state new_window_state = ctx.frame_window_state;
|
ctx.gtk_content_height = ctx.frame_content_height;
|
||||||
|
ctx.gtk_window_state = ctx.frame_window_state;
|
||||||
|
ctx.decoration_type = decoration_type_from_window_state(ctx.frame_window_state);
|
||||||
|
|
||||||
int old_content_width = ctx.gtk_content_width;
|
draw_decoration();
|
||||||
int old_content_height = ctx.gtk_content_height;
|
|
||||||
int new_content_width = ctx.frame_content_width;
|
|
||||||
int new_content_height = ctx.frame_content_height;
|
|
||||||
|
|
||||||
enum decoration_type old_decoration_type = ctx.decoration_type;
|
|
||||||
enum decoration_type new_decoration_type = decoration_type_from_window_state(new_window_state);
|
|
||||||
|
|
||||||
if (old_decoration_type != new_decoration_type ||
|
|
||||||
old_content_width != new_content_width ||
|
|
||||||
old_content_height != new_content_height ||
|
|
||||||
old_window_state != new_window_state){
|
|
||||||
|
|
||||||
ctx.gtk_content_width = new_content_width;
|
|
||||||
ctx.gtk_content_height = new_content_height;
|
|
||||||
ctx.gtk_window_state = new_window_state;
|
|
||||||
ctx.decoration_type = new_decoration_type;
|
|
||||||
|
|
||||||
draw_decoration();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
g_clear_pointer(&ctx.header, gtk_widget_destroy);
|
g_clear_pointer(&ctx.header, gtk_widget_destroy);
|
||||||
|
|
@ -1308,8 +1291,7 @@ libdecor_frame_commit(void){
|
||||||
extent.h += border_size.y[0] + border_size.y[1];
|
extent.h += border_size.y[0] + border_size.y[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
xdg_surface_set_window_geometry(ctx.xdg_surface, extent.x, extent.y,
|
xdg_surface_set_window_geometry(ctx.xdg_surface, extent.x, extent.y, extent.w, extent.h);
|
||||||
extent.w, extent.h);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue