~unity-team/nux/nux.dyn-casting

« back to all changes in this revision

Viewing changes to Nux/BaseWindow.cpp

  • Committer: Jason Smith
  • Date: 2011-03-18 14:29:07 UTC
  • Revision ID: jason.smith@canonical.com-20110318142907-3uz6vw2mm00wwvgx
make input windows simply unmap rather than destroy/create when turning on/off. This is faster :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
#if defined(NUX_OS_LINUX)
87
87
    if (m_input_window)
88
 
    {
89
 
      EnableInputWindow (false);
90
 
    }
 
88
      delete m_input_window;
91
89
#endif
92
90
 
93
91
    // At this stage, the reference count of this object is 0 and while the weak reference count is > 0.
310
308
    if (b)
311
309
    {
312
310
      if (m_input_window == 0)
313
 
      {
314
311
        m_input_window = new XInputWindow (title, take_focus, override_redirect);
315
 
        m_input_window->SetGeometry (GetGeometry());
316
 
      }
 
312
        
 
313
      m_input_window->Show ();
 
314
      m_input_window->SetGeometry (GetGeometry());
317
315
      m_input_window_enabled = true;
318
316
    }
319
317
    else
320
318
    {
321
319
      if (m_input_window)
322
 
      {
323
 
        delete (m_input_window);
324
 
        m_input_window = 0;
325
 
      }
 
320
        m_input_window->Hide ();
326
321
      m_input_window_enabled = false;
327
322
    }
328
323
  }
334
329
  
335
330
  void BaseWindow::InputWindowEnableStruts (bool enable)
336
331
  {
337
 
    if (!m_input_window_enabled)
338
 
      return;
339
 
    
340
 
    m_input_window->EnableStruts (enable);
 
332
    if (m_input_window)
 
333
      m_input_window->EnableStruts (enable);
341
334
  }
342
335
  
343
336
  bool BaseWindow::InputWindowStrutsEnabled ()
366
359
    Area::SetGeometry (geo);
367
360
    
368
361
    #if defined(NUX_OS_LINUX)
369
 
    if (m_input_window_enabled)
 
362
    if (m_input_window)
370
363
      m_input_window->SetGeometry (geo);
371
364
    #endif
372
365
    //LayoutWindowElements();