if (dx > 0 || dy > 0) { translate = g_new (GdkSuperWinTranslate, 1); translate->dx = MAX (0, dx); translate->dy = MAX (0, dy); translate->serial = NextRequest (GDK_DISPLAY()); superwin->translate_queue = g_list_append (superwin->translate_queue, translate); }  gdk_window_move_resize (superwin->bin_window, MIN (0, -dx), MIN (0, -dy), width + ABS(dx), height + ABS(dy));  gdk_window_move (superwin->bin_window, MIN (0, -dx) + dx, MIN (0, -dy) + dy);  if (dx < 0 || dy < 0) { translate = g_new (GdkSuperWinTranslate, 1); translate->dx = MIN (0, dx); translate->dy = MIN (0, dy); translate->serial = NextRequest (GDK_DISPLAY()); superwin->translate_queue = g_list_append (superwin->translate_queue, translate); }  gdk_window_move_resize (superwin->bin_window, 0, 0, width, height);  if (dx < 0) { gdk_superwin_expose_area(superwin, width + dx, 0, -dx, height); } else if (dx > 0) { gdk_superwin_expose_area(superwin, 0, 0, dx, height); }  if (dy < 0) { gdk_superwin_expose_area(superwin, 0, height + dy, width, -dy); } else if (dy > 0) { gdk_superwin_expose_area(superwin, 0, 0, width, dy); }
first_resize_width = width; first_resize_height = height;   if (dx < 0) {  first_resize_x = 0;  first_resize_width = width + ABS(dx); }   if (dx > 0) {  first_resize_x = -dx;  first_resize_width = width + dx; }   if (dy < 0) {  first_resize_y = 0;  first_resize_height = height + ABS(dy); }   if (dy > 0) {  first_resize_y = -dy;  first_resize_height = height + dy; }     if (dx < 0) {  move_x = dx; }   if (dx > 0) { move_x = 0; }   if (dy < 0) {  move_y = dy; }   if (dy > 0) { move_y = 0; }   first_resize_serial = NextRequest(GDK_DISPLAY());   gdk_window_move_resize(superwin->bin_window, first_resize_x, first_resize_y, first_resize_width, first_resize_height);    move_serial = NextRequest(GDK_DISPLAY());  gdk_window_move(superwin->bin_window, move_x, move_y);     last_resize_serial = NextRequest(GDK_DISPLAY());  gdk_window_move_resize(superwin->bin_window, 0, 0, width, height);     if (dx < 0) { gdk_superwin_expose_area(superwin, MAX(0, width - ABS(dx)), 0, MIN(width, ABS(dx)), height);  gdk_superwin_add_antiexpose(superwin, move_serial, MAX(width, ABS(dx)), 0, MIN(width, ABS(dx)), height); }   if (dx > 0) { gdk_superwin_expose_area(superwin, 0, 0, MIN(width, ABS(dx)), height);  gdk_superwin_add_antiexpose(superwin, move_serial, 0, 0, MIN(width, ABS(dx)), height); }    if (dy < 0) { gdk_superwin_expose_area(superwin, 0, MAX(0, height - ABS(dy)), width, MIN(height, ABS(dy)));  gdk_superwin_add_antiexpose(superwin, move_serial, 0, MAX(height, ABS(dy)), width, MIN(height, ABS(dy))); }   if (dy > 0) { gdk_superwin_expose_area(superwin, 0, 0, width, MIN(height, ABS(dy)));  gdk_superwin_add_antiexpose(superwin, move_serial, 0, 0, width, MIN(height, ABS(dy))); }   if (dx > 0 || dy > 0) { gdk_superwin_add_translation(superwin, first_resize_serial, MAX(0, dx), MAX(0, dy)); }   if (dx < 0 || dy < 0) { gdk_superwin_add_translation(superwin, last_resize_serial, MIN(0, dx), MIN(0, dy)); }
gdk_superwin_scroll (GdkSuperWin *superwin,                     gint dx,                     gint dy){  GdkSuperWinTranslate *translate;  gint width, height;  gdk_window_get_size (superwin->shell_window, &width, &height);  if (dx > 0 || dy > 0)     {      translate = g_new (GdkSuperWinTranslate, 1);      translate->dx = MAX (0, dx);      translate->dy = MAX (0, dy);      translate->serial = NextRequest (GDK_DISPLAY());      superwin->translate_queue = g_list_append (superwin->translate_queue, translate);    }    gdk_window_move_resize (superwin->bin_window,			  MIN (0, -dx), MIN (0, -dy),			  width + ABS(dx), height + ABS(dy));  gdk_window_move (superwin->bin_window,		   MIN (0, -dx) + dx, MIN (0, -dy) + dy);    if (dx < 0 || dy < 0)     {      translate = g_new (GdkSuperWinTranslate, 1);      translate->dx = MIN (0, dx);      translate->dy = MIN (0, dy);      translate->serial = NextRequest (GDK_DISPLAY());      superwin->translate_queue = g_list_append (superwin->translate_queue, translate);    }  gdk_window_move_resize (superwin->bin_window,			  0, 0, width, height);  if (dx < 0)  {    gdk_superwin_expose_area(superwin,                             width + dx, 0,                             -dx, height);  }  else if (dx > 0)  {    gdk_superwin_expose_area(superwin,                             0, 0,                             dx, height);  }  if (dy < 0)  {    gdk_superwin_expose_area(superwin,                             0, height + dy,                             width, -dy);  }  else if (dy > 0)  {    gdk_superwin_expose_area(superwin,                             0, 0,                             width, dy);  }}