Previous 199869 Revisions Next

r30628 Saturday 24th May, 2014 at 03:32:55 UTC by R. Belmont
debugqt: Un-revert and add fix for focus seizure [Carl]
[src/osd/modules/debugger]debugqt.c

trunk/src/osd/modules/debugger/debugqt.c
r30627r30628
22//
33//  debugqt.c - SDL/QT debug window handling
44//
5//  Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
5//  Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//  SDLMAME by Olivier Galibert and R. Belmont
r30627r30628
278278         continue;
279279      widget->show();
280280   }
281   bring_main_window_to_front();
282281
282   if (firststop)
283   {
284      bring_main_window_to_front();
285   }
286
283287   // Set the main window to display the proper cpu
284288   mainQtWindow->setProcessor(&device);
285289
286290   // Run our own QT event loop
287   while (debug_cpu_is_stopped(m_osd.machine()))
291   osd_sleep(50000);
292   qApp->processEvents(QEventLoop::AllEvents, 1);
293
294   // Refresh everyone if requested
295   if (mainQtWindow->wantsRefresh())
288296   {
289      osd_sleep(50000);
290      qApp->processEvents(QEventLoop::AllEvents, 1);
297      QWidgetList allWidgets = qApp->allWidgets();
298      for (int i = 0; i < allWidgets.length(); i++)
299         allWidgets[i]->update();
300      mainQtWindow->clearRefreshFlag();
301   }
291302
292      // Refresh everyone if requested
293      if (mainQtWindow->wantsRefresh())
303   // Hide all top level widgets if requested
304   if (mainQtWindow->wantsHide())
305   {
306      foreach (QWidget* widget, QApplication::topLevelWidgets())
294307      {
295         QWidgetList allWidgets = qApp->allWidgets();
296         for (int i = 0; i < allWidgets.length(); i++)
297            allWidgets[i]->update();
298         mainQtWindow->clearRefreshFlag();
308         if (!widget->isWindow() || widget->windowType() != Qt::Window)
309            continue;
310         widget->hide();
299311      }
312      mainQtWindow->clearHideFlag();
313   }
300314
301      // Hide all top level widgets if requested
302      if (mainQtWindow->wantsHide())
303      {
304         foreach (QWidget* widget, QApplication::topLevelWidgets())
305         {
306            if (!widget->isWindow() || widget->windowType() != Qt::Window)
307               continue;
308            widget->hide();
309         }
310         mainQtWindow->clearHideFlag();
311      }
312
313      // Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset)
314      if (m_osd.machine().scheduled_event_pending())
315      {
316         // Keep a list of windows we want to save.
317         // We need to do this here because by the time xml_configuration_save gets called
318         // all the QT windows are already gone.
319         gather_save_configurations();
320         break;
321      }
315   // Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset)
316   if (m_osd.machine().scheduled_event_pending())
317   {
318      // Keep a list of windows we want to save.
319      // We need to do this here because by the time xml_configuration_save gets called
320      // all the QT windows are already gone.
321      gather_save_configurations();
322   }
322323#if defined(WIN32) && !defined(SDLMAME_WIN32)
323324      winwindow_update_cursor_state(m_osd.machine()); // make sure the cursor isn't hidden while in debugger
324325#endif
325   }
326326}
327327
328328

Previous 199869 Revisions Next


© 1997-2024 The MAME Team