コード例 #1
0
ファイル: iRandR.cpp プロジェクト: vcgato29/engine-1
bool iRandR::restore( internal::_config _conf ) {
   if ( !isRandRSupported() )
      return false;

   vChangeCRTC_V_RandR.clear();
   vChangeCRTC_V_RandR = _conf.CRTCInfo;

   if ( !applyNewRandRSettings() )
      return false;

   // Who is primary?
   XRRSetOutputPrimary( vDisplay_X11, vRootWindow_X11, _conf.primary );


   // Reset gamma
   if ( _conf.gamma.size() != vCRTC_V_RandR.size() ) {
      eLOG( "RandR: Fatal internal ERROR:  _conf.gamma.size() != vCRTC_V_RandR.size()" );
      return false;
   }

   for ( unsigned int i = 0; i < _conf.CRTCInfo.size(); ++i ) {
      for ( auto &elem : _conf.gamma ) {
         XRRSetCrtcGamma( vDisplay_X11, vCRTC_V_RandR[i].id, elem );
      }
   }

   return true;
}
コード例 #2
0
ファイル: meta-output-xrandr.c プロジェクト: endlessm/mutter
void
meta_output_xrandr_apply_mode (MetaOutput *output)
{
  Display *xdisplay = xdisplay_from_output (output);

  if (output->is_primary)
    {
      XRRSetOutputPrimary (xdisplay, DefaultRootWindow (xdisplay),
                           (XID) output->winsys_id);
    }

  output_set_presentation_xrandr (output, output->is_presentation);
  output_set_underscanning_xrandr (output, output->is_underscanning);
}
コード例 #3
0
ファイル: mate-rr.c プロジェクト: dmashal/mate-desktop
void
mate_rr_screen_set_primary_output (MateRRScreen *screen,
                                    MateRROutput *output)
{
#ifdef HAVE_RANDR
#if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
    RROutput id;

    if (output)
        id = output->id;
    else
        id = None;

        /* Runtime check for RandR 1.3 or higher */
    if (screen->rr_major_version == 1 && screen->rr_minor_version >= 3)
        XRRSetOutputPrimary (screen->xdisplay, screen->xroot, id);
#endif
#endif /* HAVE_RANDR */
}
コード例 #4
0
ファイル: iRandR.cpp プロジェクト: vcgato29/engine-1
/*!
 * \brief Set _disp to the primary display
 *
 * \param _disp The display that is to be set to primary
 *
 * \returns true if everything went fine
 *
 * \note This function will change the primary display IMMEDIATELY; Calling applyNewSettings() will
 *have no effect to this.
 */
bool iRandR::setPrimary( iDisplays const &_disp ) {
   if ( !isRandRSupported() )
      return false;
   XRRSetOutputPrimary( vDisplay_X11, vRootWindow_X11, _disp.getOutput() );
   return true;
}