Bugzilla – Attachment 761 Details for
Bug 1251
XFCE changes window position after resize XConfigureWindow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Minimalist test application
Resize.java (text/x-java), 1.80 KB, created by
Johann Sorel
on 2015-10-10 14:20:20 CEST
(
hide
)
Description:
Minimalist test application
Filename:
MIME Type:
Creator:
Johann Sorel
Created:
2015-10-10 14:20:20 CEST
Size:
1.80 KB
patch
obsolete
> >package test; > >import com.jogamp.newt.event.MouseEvent; >import com.jogamp.newt.event.MouseListener; >import com.jogamp.newt.opengl.GLWindow; >import com.jogamp.opengl.GLCapabilities; >import com.jogamp.opengl.GLProfile; > >public class Resize implements MouseListener{ > > private final double[] startPos = new double[2]; > private final double[] startExt = new double[2]; > > public static void main(String[] args) throws InterruptedException { > new Resize(); > Thread.sleep(50000); > } > > GLWindow glWindow; > > public Resize() { > > GLCapabilities glCapabilities = new GLCapabilities(GLProfile.getDefault()); > glWindow = GLWindow.create(glCapabilities); > > //attach listeners > glWindow.addMouseListener(this); > glWindow.setSize(400, 200); > glWindow.setPosition(300, 300); > glWindow.setVisible(true); > > } > > @Override > public void mouseClicked(MouseEvent me) { > } > > @Override > public void mouseEntered(MouseEvent me) { > } > > @Override > public void mouseExited(MouseEvent me) { > } > > @Override > public void mousePressed(MouseEvent me) { > startPos[0] = me.getX(); > startPos[1] = me.getY(); > startExt[0] = glWindow.getWidth(); > startExt[1] = glWindow.getHeight(); > } > > @Override > public void mouseReleased(MouseEvent me) { > } > > @Override > public void mouseMoved(MouseEvent me) { > } > > @Override > public void mouseDragged(MouseEvent me) { > double x = me.getX(); > double y = me.getY(); > double diffx = x- startPos[0]; > double diffy = y- startPos[1]; > > glWindow.setSize( > (int)(startExt[0]+diffx), > (int)(startExt[1]+diffy)); > } > > @Override > public void mouseWheelMoved(MouseEvent me) { > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1251
: 761