  We report a first detection, at very high significance ($25\sigma$), of the
cross-correlation between cosmic shear and the diffuse X-ray background, using
data from the Dark Energy Survey and the ROSAT satellite. The X-ray
cross-correlation signal is sensitive to the distribution of the surrounding
gas in dark matter haloes. This allows us to use our measurements to place
constraints on key physical parameters that determine the impact of baryonic
effects in the matter power spectrum. In particular, we determine the mass of
haloes in which feedback has expelled half of their gas content on average to
be $\log_{10}(M_c/M_\odot)=13.643^{+0.081}_{-0.12}$, and the polytropic index
of the gas to be $\Gamma = 1.231^{+0.015}_{-0.011}$. This represents a first
step in the direct use of X-ray cross-correlations to obtain improved
constraints on cosmology and the physics of the intergalactic gas.
