]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - panel/p_move.c
ncurses 5.9 - patch 20141220
[ncurses.git] / panel / p_move.c
index 3818e8cba860c773c3f1606128497c545abc5632..adae64583220edb80c886da437e92c04b195ddcc 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2009          *
  ****************************************************************************/
 
 /* p_move.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $")
+MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $")
 
 NCURSES_EXPORT(int)
 move_panel(PANEL * pan, int starty, int startx)
 {
-  T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
+  int rc = ERR;
 
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx));
 
-  if (IS_LINKED(pan))
+  if (pan)
     {
-      Touchpan(pan);
-      PANEL_UPDATE(pan, (PANEL *) 0);
+      GetHook(pan);
+      if (IS_LINKED(pan))
+       {
+         Touchpan(pan);
+         PANEL_UPDATE(pan, (PANEL *) 0);
+       }
+      rc = mvwin(pan->win, starty, startx);
     }
-
-  returnCode(mvwin(pan->win, starty, startx));
+  returnCode(rc);
 }