Let $X$ be a compact Riemann surface and $E \rightarrow X$ a holomorphic vector bundle of rank $n$. We can construct a projective bundle $\mathbb{P}(E) \rightarrow X$ by taking the projective spaces of the fibers of $E$. There is an exact sequence of sheaves $$1 \rightarrow \mathcal{O}^* \rightarrow GL(n,\mathcal{O}) \rightarrow PGL(n,\mathcal{O})\rightarrow 1$$ by considering $1 \rightarrow \mathbb{C}^* \rightarrow GL(n,\mathbb{C}) \rightarrow PGL(n,\mathbb{C}) \rightarrow 1$.
Since $H^2(X,\mathcal{O}^*) = 0$, we have $H^1(X,GL(n,\mathcal{O})) \rightarrow H^1(X,PGL(n,\mathcal{O}))$ is surjective, i.e. every projective bundle on Riemann surface arises from some vector bundle. By an analogous definition of flat vector bundle, we also have a notion of flat projective bundle. It is obvious that $\mathbb{P}(E)$ is flat if $E$ is flat. My question is
Let $\phi$ be a flat projective bundle on Riemann surface $X$, can we find a flat vector bundle $E$ on $X$ such that $\phi = \mathbb{P}(E)$?
I think the answer is "NO", but I can't give a proof by counterexample. For simplicity, we can consider $n=2$ i.e. $\phi$ is a flat $\mathbb{P}^1$ bundle. Let $\phi = \mathbb{P}(E)$ for some holomorphic vector bundle of rank 2. The question is equivalent to the degree of $E$ is even or odd under the isomorphism $H^2(X,\mathbb{Z}) \cong \mathbb{Z}$. Any comment is welcome, thank you.