fix warnings about clipboard when building ui on linux

pull/3428/head
Delyan Angelov 2020-01-13 18:53:56 +02:00 committed by Alexander Medvednikov
parent 4c55d3677d
commit 4a82770f16
1 changed files with 2 additions and 4 deletions

View File

@ -137,7 +137,7 @@ fn new_x11_clipboard(selection atom_type) &Clipboard {
if display == C.NULL { if display == C.NULL {
println("ERROR: No X Server running. Clipboard cannot be used.") println("ERROR: No X Server running. Clipboard cannot be used.")
return &Clipboard{} return &Clipboard{ display: 0 }
} }
mut cb := &Clipboard{ mut cb := &Clipboard{
@ -257,7 +257,7 @@ fn (cb mut Clipboard) start_listener(){
} }
C.SelectionRequest { C.SelectionRequest {
if event.xselectionrequest.selection == cb.selection { if event.xselectionrequest.selection == cb.selection {
mut xsre := &XSelectionRequestEvent{} mut xsre := &XSelectionRequestEvent{ display: 0 }
xsre = &event.xselectionrequest xsre = &event.xselectionrequest
mut xse := XSelectionEvent{ mut xse := XSelectionEvent{
@ -361,8 +361,6 @@ fn (cb &Clipboard) pick_target(prop Property) Atom {
//This is higher than the maximum priority. //This is higher than the maximum priority.
mut priority := math.max_i32 mut priority := math.max_i32
supported_targets := cb.get_supported_targets()
for i := 0; i < prop.nitems; i++ { for i := 0; i < prop.nitems; i++ {
//See if this data type is allowed and of higher priority (closer to zero) //See if this data type is allowed and of higher priority (closer to zero)
//than the present one. //than the present one.